1
在這裏是一個示例大熊貓數據幀:系列對象沒有屬性「條」
id product_type qty
1 product_type 1 100
2 product_type 2 300
3 product_type 1 200
我想以此獲得了以下新的數據幀,以刪除product_type
在列product_type
:
id product_type qty
1 1 100
2 2 300
3 1 200
這是我如何嘗試去做的:
orders['product_type'].strip('product_type ')
但是有一個錯誤:
'Series' object has no attribute 'strip'
會自動更新數據幀或我應該將這個表達式的結果保存在一個新的數據框中?即訂單=訂單[...] ... – JoeBlack
是的,你需要分配結果返回 – EdChum