1
我有一个CSV列表,但它们没有列名。使用我在Python 2.7中的代码追加,但每个CSV中的第一行被识别为列名。我如何追加没有列名的CSV。例如:无列名添加CSV
1 2 3
a b 3
2 4 1
a e r
Append:
1 2 3
a b 3
2 4 1
a e r
的代码如下:
import os
import pandas as pd
targetdir = r'E:/tals/ICF/Base Admision San Marcos 2015-1'
filelist = os.listdir(targetdir)
big_df=pd.DataFrame()
for filename in filelist:
big_df = big_df.append(pd.read_csv(os.path.join(targetdir, filename)),ignore_index=True)
你能接受我的答案,如果它整理你出去,就会有一个空的刻度在投票箭头下方,这将标记问题为已回答。 – EdChum 2014-09-23 19:23:38