SDC-BIDS-sMRI icon indicating copy to clipboard operation
SDC-BIDS-sMRI copied to clipboard

Issue with append in the first notebook

Open mirhnius opened this issue 6 months ago • 1 comments

In the T1 and T2 relaxation and image contrast section, there is a tiny bug. You have tried to concatenate two data frames with append attribute. append is deprecated and if you try to run the cell, you will face an error. Use concate instead.

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])

mirhnius avatar Dec 12 '23 16:12 mirhnius