分段错误:pandas to_csv操作期间为11 [英] Segmentation fault: 11 during pandas to_csv operation
问题描述
我正在使用Python 2.7 virtualenv和通过pip安装的熊猫在Mac OS 10.10.5上工作.
I'm working on Mac OS 10.10.5, using a Python 2.7 virtualenv and pandas installed via pip.
我有一个Pandas dataFrame(称为"pivot"),它是13843行乘40列.大多数数据单元都是单个字符(A,B,C或D).
I have a Pandas dataFrame (called 'pivot') which is 13843 rows by 40 columns. Most of the data cells are single characters (A, B, C or D).
我正在尝试使用以下命令将其导出到csv文件:
I am trying to export this to a csv file using the command:
pivot.to_csv(path_or_buf="test.csv",sep=",", encoding='utf-8')
输出CSV到达第8743行,该行在第8列之后被截断,并且该程序因分段错误而崩溃:11
The output CSV gets to row 8743, which is truncated after the 8th column, and the program crashes out with a Segmentation fault: 11
这不应该是内存问题,因为我的Mac具有16Gb RAM.
It shouldn't be a memory problem, as my Mac has 16Gb RAM.
有什么想法吗?
谢谢
标记
推荐答案
原来是数据问题.在某些情况下,我尝试透视重复的数据行.
Turned out to be an issue with the data. There were instances where I was trying to pivot duplicate data rows.
这篇关于分段错误:pandas to_csv操作期间为11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!