Answer the question
In order to leave comments, you need to log in
How to read CSV file in Python not from 1 line?
There is a CSV file.
I read it:
csv_data = csv.reader(file('temp.csv'))
for row in csv_data:
print row
Answer the question
In order to leave comments, you need to log in
import csv
csv_iter = csv.reader(file('temp.csv'))
next(csv_iter)
for row in csv_iter:
print row
I dare to assume that you want to skip the first line, because there are column names. In this case, I recommend using csv.DictReader
from pandas import read_csv
out = read_csv(your_file, sep=';', skiprows=[0], header=None)
It's a crutch, but it works
csv_data = csv.reader(file('temp.csv'))
data = []
for row in csv_data:
data.append(row)
print data[1:]
Do you want all the latest and complete control over the system?
Want to set up your desktop so that the girls give?
Your choice of Arch Linux:
- Latest packages
- Full control over the system
- Set up once, and work for years (until something breaks)
I currently have openSUSE 13.2 on a semi-working laptop
and the "stable kernel and new software versions" is Arch Linux
For a beginner Linux Munt is best, for Gentoo gurus it's the middle of EVERYTHING else ;)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question