I am trying to read 17 files in a loop where I want to skip 1 row for few files but not for others.
Using the code as given below
import os
import pandas as pd
import glob
path=os.getcwd()
files=os.listdie(os.curdir)
files_xls=[f for f in files if f[-3]=='xls']
filenames=glob.glob(path + "/.xls")
for f in files_xls:
data=pd.read_excel(f, (skiprows==1 if data.iloc[0]==range(1, 68,1)])
I know the code is incomplete and wrong in last line but my first goal is to able to write the code for skiping rows for few not all files.
Please help me write the code to skip the row.
For eg few sample data looks like below
1 2 3
Name Age Sex
one 23 M
two 32 F
three 46 M
And some sample look like this
Name Age Sex
four 67 M
five 78 F
six 89 M
and Final output should look like this
Name Age Sex
one 23 M
two 32 F
three 46 M
four 67 M
five 78 F
six 89 M
P.S. I am new to programming.
Thanks in advance