I am trying to combine a list of csv files as per the code below. However the source csv file does not have a header and hence the final Dataframe takes the first row of the first csv file as the header. How could I change the below code to ensure the first row is not taken as the header of the Dataframe.
dfs = [pd.read_csv(fp).assign(New=os.path.basename(fp)) for fp in allFiles]
out_df = pd.concat(dfs, ignore_index=True)
out_df
Sample output is:
,Peter,23,Melbourne
0,Smith,20,Sydney
1,Scott,21,Victoria
Appreciate any help on this. Thanks