我想知道哪种方法最适合在我的dataframe中更改整个专栏中的内容。我的部分dataframe有“百分比”列,该列中的内容标记为"#%“。在这里,我想调整整列从百分比到十进制数。例如,80%至0.80 %和42%至0.42 %。做这种调整的最好方法是什么?
提前谢谢。
发布于 2022-11-21 06:18:04
df['DataFrame Column'] = df['DataFrame Column'].str[:-1].astype(float)/100https://stackoverflow.com/questions/74514865
复制相似问题