-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRead_Data.py
More file actions
24 lines (19 loc) · 820 Bytes
/
Read_Data.py
File metadata and controls
24 lines (19 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# References:
# https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html
pd.read_csv()
file_name = 'CONNECTOME_MATRICES.csv'
con_mat = pd.read_csv(file_path + file_name, index_col='Id')
con_mat_2 = pd.read_csv(file_path + file_name, index_col='Id', true_values = ['yes'], false_values = ['no'])
# 'yes' is considered as True, 'no is considered as False'
con_mat.head()
pd.read_excel()
file_path = '/Users/xyz/data/'
file_name = 'METADATA.xlsx'
df_meta = pd.read_excel(file_path + file_name, sheet_name='combined')
df_meta.head()
pd.read_json()
pd.read_clipboard()
# Get a glimpse of 20 values randomly selected in a column named disease
df.disease.sample(n=20)
# Get a glimpse of 20 values randomly selected of the disease column that are not 'Norovirus'
df[df.disease != 'Norovirus'].disease.sample(n=20)