1
我有一個DF它看起來像這樣:Python的熊貓:如果在列標籤找到替代定的字符
Label PG & PCF EE-LV Centre UMP FN
Label
Très favorable 2.68 3.95 4.20 3.33 3.05
Plutôt favorable 12.45 42.10 19.43 2.05 1.77
Plutôt défavorable 43.95 41.93 34.93 20.15 15.97
Très défavorable 37.28 9.11 41.44 70.26 75.99
Je ne sais pas 3.63 2.91 0.10 4.21 3.22
我只是想取代「&」與「和」裏發現,無論是在列標籤或索引標籤。
我會一直拍攝這樣的事情wouldve工作,但它沒有...
dataframe.columns.replace("&","and")
任何想法?