0
在DataFrame的不同行的索引列中進行一些更改的最簡單方法是什麼?如何使用Apply()和自定義函數更改DataFrame中的數據?
def fn(country):
if any(char.isdigit() for char in country):
return country[:-2]
else:
return country
df.loc["Country"].apply(fn,axis=1)
請添加一段數據 – Dark