I am trying to write data into individual cell of my pandas dataframe but am not able to do it.
For example, my initialized dataframe looks like this:
PF44 PF62 PF12
aa ss aa ss aa ss
1B38:A|ABCDE|DDFE|QUAD NaN NaN NaN NaN NaN NaN
I can access a particular element of my dataframe using the following command:
>>>feat_df.loc['1B38:A|ABCDE|DDFE|QUAD']['PF44']['ss']
and the output is nan. However, if I want to change this to say a number 5 or a text 'test', I used the following commands:
>>>feat_df.loc['1B38:A|ABCDE|DDFE|QUAD']['PF44']['ss'] =5
or
>>>feat_df.loc['1B38:A|ABCDE|DDFE|QUAD']['PF44']['ss']='test'
neither returned any error but when the check the value:
>>>feat_df.loc['1B38:A|ABCDE|DDFE|QUAD']['PF44']['ss']
its still shows
nan