reassign the index of the dataframe without adding a column

I think you really need to provide the CSV content to make this answerable, but you could try using the index_col argument to pandas.read_csv:

df = pd.read_csv(file_path + '/' + ticker, index_col=["time"])
df = df.iloc[:,[0,2,3,4,5,6]]

You may also want to consider the usecols argument if you only need a subset of columns.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top