- Well-known, popular data analytics library
- Many read and write handlers to import/export data
- IO Tools: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html
6/16/2021
save()
/load()
saveRDS()
/readRDS()
# MULTIPLE OBJECTS save(df1, df2, df3, file="/path/to/myrdata.rda", compress="gzip") load("/path/to/myrdata.rda") # INDIVIDUAL OBJECTS saveRDS(df1, file="/path/to/df1.rds", compression="bzip2") new_df1 <- readRDS("/path/to/df1.rds") saveRDS(df2, file="/path/to/df2.rds", compression="xz") new_df2 <- readRDS("/path/to/df2.rds") saveRDS(df3, file="/path/to/df3.rds", compression=FALSE) new_df3 <- readRDS("/path/to/df3.rds")
import rdata
pandas.io.rdata
:import pandas as pd # READ RDATA dfs = pd.read_rdata("/path/to/rds_file.rds") dfs = pd.read_rdata("/path/to/rda_file.rda", file_format="rda", rownames = False, select_frames=["df1", "df3", "df5"], ) # WRITE RDATA df1.to_rdata("/path/to/new/rds_file.rds") df2.to_rdata("/path/to/new/rda_file.rda", rda_name="my_df", index=False, compression="bz2" )
prep_test_rdata.R