Aug-20-2020, 03:31 PM
The following would read currency exchange rate data from an excel file online, but within the workbook, table name is written on row 1, column header is written on row 2 instead.
Any help would be very appreciated.
import pandas as pd erdata = pd.read_csv("https://www.censtatd.gov.hk/showtablecsv.jsp?TableID=124") print(erdata)Since dataframe always identifies row 1 as column header, it would incorrectly identify only two columns in the workbook. And as usual the following drop function only remove row 2 which is the real column header.
print(erdata.drop(erdata.index[0]))How to use codes (without manual downloading and excel editing) to remove the top row and make it correctly identify row 2 as the column header?
Any help would be very appreciated.