In order to read a csv in that doesn’t have a header and for only certain columns you need to pass params header=None
and usecols=[3,6]
for the 4th and 7th columns:
df = pd.read_csv(file_path, header=None, usecols=[3,6])
See the docs
More Related Contents:
- Replacing values represented by 'UN' with NaN
- error when applying function to a series object
- How to group dataframe rows into list in pandas groupby
- Replace values in a pandas series via dictionary efficiently
- Get a list from Pandas DataFrame column headers
- How to convert string to datetime format in pandas python?
- How to insert pandas dataframe via mysqldb into database?
- Update a dataframe in pandas while iterating row by row
- SQLAlchemy ORM conversion to pandas DataFrame
- Pandas – Explanation on apply function being slow
- Pandas sum by groupby, but exclude certain columns
- Conditionally format Python pandas cell
- import csv with different number of columns per row using Pandas
- Selecting columns from pandas MultiIndex
- Pandas convert string to int
- Benefits of panda’s multiindex?
- Pandas pd.Series.isin performance with set versus array
- Convert pandas series from string to unique int ids [duplicate]
- Get week start date (Monday) from a date column in Python (pandas)?
- Pandas dataframe – running sum with reset
- Need of using ‘r’ before path-name while reading a csv file with pandas
- pandas.io.json.json_normalize with very nested json
- Python pandas convert datetime to timestamp effectively through dt accessor
- Time Series Analysis – unevenly spaced measures – pandas + statsmodels
- Move column by name to front of table in pandas
- Convert List to Pandas Dataframe Column
- matplotlib savefig() size control
- Is there a way to speed up handling large CSVs and dataframes in python?
- How to unpack a Series of tuples in Pandas?
- How to upload a CSV file in FastAPI and convert it into a Pandas Dataframe?