I have a partial code to import excel into Python as strings. How I can exclude first row when importing data from excel into Python?
import pandas as pd
data = pd.read_excel(".xlsx", parse_cols="A,C,E,G, I, K, M, O, Q, S, U, W, Y, AA, AC, AE, AG, AI, AK, AM, AO, AQ, AS, AU, AW, AY, BA, BC, BE, BG, BI, BK, BM, BO, BQ, BS, BU, BW, BY, CA, CC, CE, CG, CI, CK, CM, CO, CQ, CS, CU, CW, CY, DA, DC, DE, DG, DI, DK, DM, DO, DQ, DS, DU, DW, DY, EA, EC, DE, EG, EI, EK, EM, EO, EQ, ES, EU, EW, EY")
data = data.to_string()
The pandas documentation for the pd.read_excel
method mentions a skiprows
parameter that you can use exclude the first row of your excel file.
Example
import pandas as pd
data = pd.read_excel("file.xlsx", parse_cols="A,C,E,G", skiprows=[0])
Source: pandas docs