Set value for particular cell in pandas DataFrame using index

后端 未结 20 1847
野趣味
野趣味 2020-11-22 05:45

I\'ve created a Pandas DataFrame

df = DataFrame(index=[\'A\',\'B\',\'C\'], columns=[\'x\',\'y\'])

and got this

    x    y
A  NaN         


        
20条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 06:32

    df.loc['c','x']=10 This will change the value of cth row and xth column.

提交回复
热议问题