Aug-25-2023, 06:59 PM
(Aug-25-2023, 06:30 PM)tester_V Wrote: I found there are blank rows at the beginning of the Excel file, Unnamed 0, Unnamed 1, and so on.
import pandas as pd df = pd.read_excel('test1.xlsx'df)
>>> df Unnamed: 0 Unnamed: 1 datettime ... Hostname Vlan nonWPdschBler 0 NaN NaN 20221108.181509.814817 ... EPW ajjj 25 1 NaN NaN 20221108.181519.814948 ... ETW ab 50 [2 rows x 8 columns] >>> df2 = df[df.columns[2:]] >>> df2 datettime Tput Description Hostname Vlan nonWPdschBler 0 20221108.181509.814817 0.000091 router EPW ajjj 25 1 20221108.181519.814948 0.000131 WIDIS ETW ab 50Remove when read in.
import pandas as pd df = pd.read_excel('test1.xlsx', usecols=lambda x: 'Unnamed' not in x)
>>> df datettime Tput Description Hostname Vlan nonWPdschBler 0 20221108.181509.814817 0.000091 router EPW ajjj 25 1 20221108.181519.814948 0.000131 WIDIS ETW ab 50