I want to read a specific line in a csv file in pandas on python.Here on this image I want to read the 19010101 date enter image description here
1 Answer
You can specify the column you want to use
df=read_csv(yourcsv.csv)
dates = df['DATE'].values.tolist()
print(dates[0])
Bunch of ways to do this, just depends on your requirements. Iloc function might be of use to you too.
2 Comments
DerrickAtWork
Glad to help! Good luck on your project
CH4
Is it possible to specify which line you want to read? eg I want to read 3 line from behind (index = -3)