-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestGenDataframe.py
More file actions
44 lines (32 loc) · 966 Bytes
/
Copy pathTestGenDataframe.py
File metadata and controls
44 lines (32 loc) · 966 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import numpy as np
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
from scipy import stats
import seaborn as sns
from scipy.stats import bootstrap
from IPython.display import display
# Make a new df - this will contain a series for each somitoif
df_avn=pd.DataFrame({'sample_ind': -1},index=[-1])
for i in range(5):
dixt_add={}
dixt_add['Var1']=i*1.0
dixt_add['Var2']=i*1.0
dixt_add['cell_type']='D5'
dixt_add['n_experiment']=i*1.0
dixt_add['sample_ind']=i*1.0
# Add new entry to spreadsheet
new_row = pd.Series(dixt_add)
df_avn=pd.concat([df_avn, new_row.to_frame().T],ignore_index=True)
df=df_avn
display(df_avn)
df=df_avn.drop(index=0)
display(df)
#df=df.drop('cell_type',axis=1)
title_Str=['Var1', 'Var2']
df=df[title_Str]
display(df)
corr_matE5=df.corr()
display(corr_matE5)
mask = np.triu(np.ones_like(corr_matE5))
chart=sns.heatmap(corr_matE5, annot=True,annot_kws={'size':5.25})