excel - Python Pandas - When using read_excel or csv is it possible to convert data type by referencing the column number? - Stack Overflow

PHOTO EMBED

Thu Dec 16 2021 07:41:55 GMT+0000 (Coordinated Universal Time)

Saved by [deleted user] #python

df = pd.read_excel(filename, dtype=str)
df.iloc[:, 5:] = df.iloc[:, 5:].astype(float)
content_copyCOPY

https://stackoverflow.com/questions/41726635/python-pandas-when-using-read-excel-or-csv-is-it-possible-to-convert-data-type