4
什么是删除文件中空列的最快方法。下面给出一个示例文件。我使用了python'pandas'软件包,但它花费了太多时间(大约10分钟后,我没有得到答案,因此退出,因为我必须为许多文件执行此操作)才能加载我的2 GB文件。删除大文件中的空列
df = read_table(inFileName, sep="\t")
df = df.dropna(axis=1,how='all') #remove columns
aaa bbb ccc ddd eee
1 a c
2 s d
3 d
f d
4 g d
5 h e
我不知道哪些字段是空的。 我使用0.9.1版本的 '熊猫'
pkg_resources.get_distribution的( “熊猫”)。 版本 '0.9.1'
你知道哪些列是空的,或者你想让程序弄清楚吗? – Danny 2013-02-21 19:42:29
尝试一些较低的级别 - C + Linux的'open','write'和'read'。 – dmg 2013-02-21 19:49:27
哪个版本您使用的是大熊猫吗?显着提高速度的速度在10.0 http://pandas.pydata.org/pandas-docs/stable/whatsnew.html#file-parsing-new-features – Zelazny7 2013-02-21 19:50:19