首页 > 解决方案 > python/pandas : Pandas 更改值,在值中添加额外的数字

问题描述

我正在通过 pandas 读取一个 csv 文件,如下所示 -

Country, Longitude, Latitude
Netherland,48.436252,-124.068561
Netherland,48.436252,-124.068561
Netherland,48.436252,-124.068561

完成处理后,它正在更改 2 行的纬度值,如下所示。

Country, Longitude, Latitude
Netherland,48.436252,-124.068561
Netherland,48.436252,-124.06856100000002
Netherland,48.436252,-124.06856100000002

这是阅读声明

input_file = pd.read_csv("country.csv",encoding = 'ISO-8859-1')

我没有做任何与经度或纬度列相关的处理。不知道为什么要更改两行中的值以及我可以做些什么来修复它。

标签: pythonpandas

解决方案


推荐阅读