Similar .rdata functions in Python?

I'm starting to learn about doing data analysis in Python.

In R, you can load data into memory, and then save the variables to a .rdata file.

I am trying to create a β€œproject” of analysis, so I can load the data, save the scripts and then save the output so that I can remember what I need.

Is there an equivalent function in Python?

thanks

+8
python r
source share
2 answers

What you are looking for is binary serialization. The most notable functionality for this in Python is pickle . If you have some standard scientific data structures, you can look at HDF5. JSON also works with many objects, but this is not binary serialization - it is a text version.

If you expand your options, there are many other serialization options. Such as Google Protocol Buffers (developer of Rprotobuf - this is responsible for the top rating for r tag on SO), Avro, Thrift, etc.

Although there are common serialization options such as pickle and .Rdat , a thorough review of your use will be useful for quick I / O commissioning, especially if you need random access, portability, concurrency access, tool reuse, etc. d. For example, now I try to avoid .Rdat for large objects.

+11
source share
+2
source share

All Articles