I've received an error after trying to remove a column from my dataframe. KeyError: "['column name'] not found in axis" Advice is to put axis=1, but I did that and I still receive the same error. I don't know, what the problem is.
for i in range(1,len(file_list)):
data = pd.read_table(file_list[i], encoding='unicode_escape')
df = pd.DataFrame(data)
main_dataframe = pd.concat([main_dataframe, df], axis = 1)
main_dataframe = main_dataframe.drop('column name',axis=1)
for file_name in file_list:(3) callingpd.concatin a loop is inefficient, try appending all dataframes to a list first after reading and then callingpd.concatonce at the end.