1

How to skip Column title row in Pandas DataFrame

My Code:

sample = pd.DataFrame(pd.read_csv('Fremont TMY_Sample_Original.csv', `Import csv`low_memory=False))

sample_header = sample.iloc[:1, 0:20] `Wants to separate first two row because these are different data at start `
sample2 = sample[sample.iloc[:, 0:16] `wants to take required data for next process`
sample2 = ('sample2', (header=False)) `Trying to skip column title row`
print(sample2)

expected output:

its an example

Data for all year (This row I wants to remove and Remaining I wants to keep)

Date  Time(Hour) WindSpeed(m/s)

0  5    1            10

1  4    2            17

2  6    3            16

3  7    4            11
CarComp
  • 1,929
  • 1
  • 21
  • 47

1 Answers1

2

This should work

  • df = pd.read_csv("yourfile.csv", header = None)
Waqar Bin Kalim
  • 321
  • 1
  • 7