0

Suppose I have this CSV file: how to delete the first three rows of it before reading it as a pandas dataframe?

enter image description here

So far I have done it manually.

I attach the code I used:

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

path = r"     .csv"

df = pd.read_csv(path, sep=';', decimal=",", low_memory=False)
df = df.iloc[17120:]

print(df.head())
#print(len(df.index))

dens = df['Density']
dens = dens.astype(float)
dens_sub = dens[68800:]
plt.plot(dens_sub)
plt.ylim([1040,1055])
plt.show()
a_cris
  • 11
  • 1

0 Answers0