I have the following dataframe:
date A B C days
1/15/19 3.373721 0.151641 0.089789 30
2/15/19 2.974086 0.1384 0.079153 30
3/15/19 2.876406 0.154186 0.076553 30
4/15/19 2.176122 0.150017 0.057916 30
5/15/19 2.099208 0.15434 0.055869 30
6/15/19 2.092377 0.15081 0.055687 30
7/15/19 2.385295 0.155956 0.063483 30
The dataframe's index is the "date" column. I am attempting to divide columns A,and B by the column named days.
I have tried the following pieces of code:
df.iloc[:,0:2]=df.iloc[:,0:2]/df['days']
I also tried this:
df.iloc[:,0:2]=df.iloc[:,0:2].div(df['days'])
Both of these operations end up resulting in NaN's in columns A and B. What am I doing wrong? Thanks