-2
我在我的熊貓數據框中有很多列,我想用特定的方法清理。我想看看是否有辦法一次完成此操作。遍歷列以清理值
這是我試過的,這不起作用。
list = list(bigtable) # this list has all the columns i want to cleanse
for index in list:
bigtable1.column = bigtable.column.str.split(',', expand=True).apply(lambda x: pd.Series(np.sort(x)).str.cat(sep=','), axis=1)
我不知道我是否應該推敲這個封閉的,但是這看起來可能是一個http://stackoverflow.com/questions/11346283重複/ renaming-columns-in-pandas/16667215#16667215 –
我的不好。請注意標題中的編輯。 – Anu
你可以發佈一個樣本輸入數據集(或列)和所需的數據集,因爲它不清楚你想實現什麼? – MaxU