Created
April 3, 2019 21:47
-
-
Save cobanov/b32a8df090fe758b9f40bc2b556437df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Apr 3 00:47:42 2019 | |
@author: coban | |
""" | |
import pandas as pd | |
import numpy as np | |
#path verilirken adres yolunun başına r harfi konulması gerekiyor.. | |
data_all = pd.read_excel(r"C:\Users\coban\Desktop\dp1.xlsx") | |
data_truncated = data_all[["IDENTIFIER", "MEASUREPOINT", "RES_MEASURE"]] | |
data_ids = np.array(data_truncated["IDENTIFIER"].unique()) | |
#columns_ measure points | |
columns_measure = data_truncated.iloc[:, 1].values | |
column_df = np.unique(columns_measure) | |
#res_measures | |
res_measures = np.matrix(data_truncated.iloc[:, 2].values) | |
res_measures = res_measures.reshape([data_ids.shape[0], column_df.shape[0]]) | |
#final matrix | |
final = pd.DataFrame(res_measures, index = data_ids, columns = column_df) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment