【发布时间】:2017-02-16 19:42:25
【问题描述】:
我在 .dfx 文件中有一些数据,我试图将其读取为带有 pandas 的 csv。但它有一些熊猫不读取的特殊字符。它们也是分隔符。I attached one line from it
当我打印文件时,“DC4”正在被删除。 SI 被正确读取为空格。我尝试了一些编码(utf-8、latin1 等),但没有成功。 I attached the printed first line as well. I marked the place where the characters should be.
我的代码很简单:
import pandas
file_log = pandas.read_csv("file_log.DFX", header=None)
print(file_log)
我希望我很清楚并且有人有想法。 提前致谢!
编辑:
输入。链接:drive.google.com/open?id=0BxMDhep-LHOIVGcybmsya2JVM28
预期输出:
88.4373 0 12.07.2014/17:05:22 38.0366 38.5179 1.3448 31.9839
30.0070 0 12.07.2014/17:14:27 38.0084 38.5091 0.0056 0.0033
【问题讨论】:
-
您能否提供一个示例输入(不是图像)和预期输出?
-
--------------------------------
-
我添加了你需要的东西,我还是解决不了,如果我只是评论它会删除特殊字符。
标签: python csv pandas dataframe