Basically, I am browsing through a bunch of CSV files and, in the end, would like to append each dataframe into one. In fact, all I need is a function like rbind . So, I did a search and followed a guide . However, I still could not get the perfect solution.
The following is sample code. For example, the form of data1 is always 47 to 42. But the form data_out_final becomes (47, 42), (47, 84) and (47, 126) after the first three files. Ideally, it should be (141, 42). In addition, I check the data1 index, which is RangeIndex(start=0, stop=47, step=1) . Rate any suggestions!
My version of pandas 0.18.1
the code
appended_data = [] for csv_each in csv_pool: data1 = pd.read_csv(csv_each, header=0)
If data_out_final = pd.concat(appended_data, axis=1) , the form data_out_final becomes (141, 94)
PS
kind of it. In fact, you need to standardize the column names to pd.concat .
source share