I am new to python panda, I am trying to read an excel file and do some calculations and fill up some rows. When I try to fill up the value and print the result, the results is still the same before I assign the value to it.
Here is what I did.
df.loc[1][13] = 2
df is just what I got from my excel file like this
df = pd.read_excel('test.xlsx',header=5)
I already checked the data in df, they are perfectly fine.
so the original value in row 1, column 13 is nan, I want to replace it with a number, such as a 2, but the code above just would not work.
df.iat[1, 13] = 2pandas.pydata.org/pandas-docs/version/0.23/….loc[row][column]is called achained assignment. Avoid it like the plague... pandas.pydata.org/pandas-docs/stable/user_guide/…