How to avoid pandas from adding indexes in dataframes when using CSV files
Use this : df = pd.read_csv("nameOfFile.csv", index_col="nameOfColToUseAsIndex") and put the name of your first column in "nameOfColToUseAsIndex".
I'm using dataframes and CSV files to manipulate data. Most of the time, my dataframes, or the one provided by the API I'm using don't have indexes. If they have indexes, especially when writing and reading CSV files, I just remove them by using the name of the column, "unnamed:0".
But this time, to_CSV places indexes in my CSV file without naming the column. So I must use df.drop(df.columns[0], axis=1, inplace=True). But for pandas, the first column is the first named, not the real first one.
I already used index=False, but it just removed an important column instead of not adding indexes.
How can I remove the first column which isn't named and haven't index to find it ?