Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Extracting Specific Columns of CSV Data into a New File

I’m working on a project in Python where I need to extract specific columns of data from a large CSV file and write it to a new file.

I’m currently using the pandas library to read the CSV and select the columns, but it’s taking a long time to process the file. Are there any ways to optimize this process and make it run faster?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Maybe usecols parameter of pandas.read_csv() is what you are looking for?

Example: https://www.statology.org/pandas-read_csv-usecols/

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading