Is there some way to take a dataframe, say,
df = pd.DataFrame({'a':[1,2,3], 'b':[4,5,6]})
and store it in temp memory as a binary object that can then be opened with
open(df, 'rb')
So then, rather than do something like
open('/home/user/data.csv', 'rb')
the code would be
df = pd.DataFrame({'a':[1,2,3], 'b':[4,5,6]})
df_rb = *command to store in temp working memory as binary readable*
open(df_rb, 'rb')
picklemodule: docs.python.org/3.8/library/pickle.htmlBytesIOdocs.python.org/3/library/io.html#io.BytesIO) instead of to a file.