Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8787263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:50:50+00:00 2026-06-13T21:50:50+00:00

Suppose I have a csv file with 400 columns. I cannot load the entire

  • 0

Suppose I have a csv file with 400 columns. I cannot load the entire file into a DataFrame (won’t fit in memory). However, I only really want 50 columns, and this will fit in memory. I don’t see any built in Pandas way to do this. What do you suggest? I’m open to using the PyTables interface, or pandas.io.sql.

The best-case scenario would be a function like: pandas.read_csv(...., columns=['name', 'age',...,'income']). I.e. we pass a list of column names (or numbers) that will be loaded.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:50:52+00:00Added an answer on June 13, 2026 at 9:50 pm

    There’s no default way to do this right now. I would suggest chunking the file and iterating over it and discarding the columns you don’t want.
    So something like pd.concat([x.ix[:, cols_to_keep] for x in pd.read_csv(..., chunksize=200)])

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's suppose I have the following line in a CSV file (I removed the
Suppose I have a CSV file with 1M email addresses. I need to iterate
Suppose I have a program running that periodically adds information to a .CSV file.
Suppose I have a .csv file with the following content: text, with commas,another text,123,text,5;
I have a csv file that has 2 columns separated by a comma -
Suppose we have a csv file(>5GB) which contains Employee name and Age column. The
I have a csv file, transcation.csv , which looks like this: TransactionID,Date,AccNum,Type,Amt 657520,02-07-1999,016901581432,Debit,16000 657524,02-07-1999,016901581432,Debit,13000
I am uploading email addresses from a CSV file, via fgetcsv() , into a
Suppose I have a custom file format, which can be analogous to N tables.
Suppose you have the following file: textfield,datetimefield,numfield foo,2008-07-01 17:50:55.004688,1 bar,2008-07-02 17:50:55.004688,2 The Ruby code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.