T1_dict = {'GM':1200, 'WM':800, 'CSF':4000, 'Bone':500}
T2_dict = {'GM':110, 'WM':80, 'CSF':750, 'Bone':50}
T1_duration = np.arange(0,4500,500)
T2_duration = np.arange(0,500,100)
relax_df = pd.DataFrame()
for tissue,T1 in T1_dict.items():
_df = pd.DataFrame()
Mz = get_Mz(T1,T1_duration)
_df['time'] = T1_duration
_df['signal'] = Mz
_df['relaxation'] = 'T1'
_df['tissue'] = tissue
relax_df = relax_df.append(_df)
relax_df = pd.concat([relax_df,_df])
In the T1 and T2 relaxation and image contrast section, there is a tiny bug. You have tried to concatenate two data frames with
appendattribute.appendis deprecated and if you try to run the cell, you will face an error. Useconcateinstead.