Hi,
I am trying to add to columns of a dataframe read from a .csv:
dfMammals = pd.read_csv(‘MamFuncDatCSV.csv’)
dfMammals[‘FANM’] = df[‘Diet-Fruit’] + df[‘Diet-Nect’]
But when I look at the results they dont make sense as they are not the sum of the values
‘Diet-Fruit’= 0,0,0,0,0,20,20,20,20,20 dtype: int64
‘Diet-Nect’=0,0,0,0,0,0,0,0,40,0 dtype: int64
‘FANM’=0,20,0,80,80,60,30,10,10,0
Could anyone tell me what may be going on?
I tried dfMammals[‘FANM’] = df[‘Diet-Fruit’] + df[‘Diet-Nect’] And I was expecting the sum of the values from each column into the ‘FANM’