Python Forum
Is there a way to save a CSV file as a python object
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a way to save a CSV file as a python object
#1
Hi all,

I was wondering if there is a way to save a CSV file as a python object in order to be read in to python quicker. The reason I am cocnerned about this is is that some of the CSV files i hold contain many thousands (10's to 100's of columns) plus many rows of features, ~30,000.

Now having the CSV file itself is not an issue.. but its bulky and takes some time to read in to python.

In r, these can be saved as an rds or r object.. which although they hold the same CSV file, the load time in to R is almost instant. Reading in the CSV file itself in to R takes a good 20-30 seconds.

Is there an equivalent for this in python as I will be reading in a lot of CSV files in to python, so having an object with CSV data would be useful if it means reading in is much faster.

Any advice would be appreciated. Thank you!
Amir
Reply


Messages In This Thread
Is there a way to save a CSV file as a python object - by amjass12 - Jul-16-2019, 11:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [solved] Save a matplotlib figure into hdf5 file paul18fr 1 2,525 Jun-08-2021, 05:58 PM
Last Post: paul18fr
  Corrupted numpy arrays when save to file. DreamingInsanity 2 3,249 Dec-14-2019, 12:12 PM
Last Post: DreamingInsanity
  save my sensor data from the bme680 into a json or csv file Plastefuchs84 1 3,150 Aug-23-2019, 03:04 AM
Last Post: Plastefuchs84
  save 2d array to file and load back ian 3 18,302 May-18-2018, 05:00 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020