UserWarning: Pandas doesn't allow columns to be created via a new attribute name

后端 未结 4 2091
南旧
南旧 2021-02-19 00:44

I am stuck with my pandas script.

Actually , i am working with two csv file(one input and the other output file). i want to copy all the rows of two column and want to m

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-19 01:11

    The solution I can think of is to use .loc to get the column. You can try df.loc[:,a] instead of df.a. Pandas dataframe columns cannot be created using the dot method to avoid potential conflicts with the dataframe attributes. Hope this helps

提交回复
热议问题