There are many ways to skip the first line. In addition to those said by Bakuriu, I would add:
with open(filename, 'r') as f:
next(f)
for line in f:
and:
with open(filename,'r') as f:
lines = f.readlines()[1:]
Related Contents:
- Import multiple csv files into pandas and concatenate into one DataFrame
- UnicodeDecodeError when reading CSV file in Pandas with Python
- How to avoid pandas creating an index in a saved csv
- What is the most efficient way to loop through dataframes with pandas?
- How to append a new row to an old CSV file in Python?
- How to skip the headers when processing a csv file using Python?
- How to add header row to a pandas DataFrame
- How do I convert this list of dictionaries to a csv file?
- How to load a tsv file into a Pandas DataFrame?
- How do I annotate types in a for-loop?
- csv.Error: iterator should return strings, not bytes
- Python Pandas: How to read only first n rows of CSV files in?
- How to frame two for loops in list comprehension python
- How to obtain the total numbers of rows from a CSV file in Python?
- How to convert CSV file to multiline JSON?
- Decreasing for loops in Python impossible?
- Is there a need for range(len(a))?
- Reading a UTF8 CSV file with Python
- Why can I use a list index as an indexing variable in a for loop? [duplicate]
- Python Pandas read_csv skip rows but keep header
- How to read a CSV file from a URL with Python?
- IndexError: too many indices for array
- Convert commas decimal separators to dots within a Dataframe
- How to keep leading zeros in a column when reading CSV with Pandas?
- Remove index column while saving csv in pandas
- Error in Reading a csv file in pandas[CParserError: Error tokenizing data. C error: Buffer overflow caught – possible malformed input file.]
- Is it possible to make a `for` loop without an iterator variable? (How can I make make code loop a set number of times?)
- pandas.read_csv from string or package data
- csv.writer writing each character of word in separate column/cell
- Python: No csv.close()?
- What is the meaning of list[:] in this code? [duplicate]
- Python: CSV write by column rather than row
- Appending to one list in a list of lists appends to all other lists, too [duplicate]
- Split string on commas but ignore commas within double-quotes?
- Python DictWriter writing UTF-8 encoded CSV files
- Writing List of Strings to Excel CSV File in Python
- python csv2libsvm.py: AttributeError: ‘_csv.reader’ object has no attribute ‘next’
- How to read csv to dataframe in Google Colab
- Key error when selecting columns in pandas dataframe after read_csv
- How can I read tar.gz file using pandas read_csv with gzip compression option?
- How to access the previous/next element in a for loop? [duplicate]
- Using python to write mysql query to csv, need to show field names
- Save results to csv file with Python
- Python parse CSV ignoring comma with double-quotes
- loop for inside lambda
- Save list of ordered tuples as CSV [duplicate]
- random iteration in Python
- Python 2 CSV writer produces wrong line terminator on Windows
- Python Dictionary to CSV
- Set index name of pandas DataFrame