17

the function signature for pandas.read_csv gives, among others, the following options:

read_csv(filepath_or_buffer, low_memory=True, memory_map=False, iterator=False, chunksize=None, ...)

I couldn't find any documentation for either low_memoryor memory_map flags. I am confused about whether these features are implemented yet and if so how do they work.

Specifically,

  1. memory_map: If implemented does it use np.memmap and if so does it store the individual columns as memmap or the rows.
  2. low_memory: Does it specify something like cache to store in memory?
  3. can we convert an existing DataFrame to a memmapped DataFrame

P.S. : versions of relevant modules

pandas==0.14.0
scipy==0.14.0
numpy==1.8.1
10
  • low_memory should prob be documented (though it is an older option that doesn't really do much). memory_map is not documented because its not implemented (nor does it do anything). So the answer to your questions are all no.
    – Jeff
    Commented Jun 16, 2014 at 18:21
  • 4
    github.com/pydata/pandas/issues/5888
    – Jeff
    Commented Jun 16, 2014 at 18:21
  • FYI, these are not in the public doc-strings either, so not sure where you are looking.
    – Jeff
    Commented Jun 16, 2014 at 18:22
  • I will revise slightly, memory_map is technically defined and tested. Never seen it used. Give it a try and report back. (it doesn't use np.memmap, but just holds a limited amount of data in-memory). But I think this is an older / deprecated option anyhow.
    – Jeff
    Commented Jun 16, 2014 at 18:26
  • 1
    Thanks @Jeff! I did a help(pd.read_csv) to get the docstrings. Thanks for the github reference.
    – goofd
    Commented Jun 16, 2014 at 18:52

1 Answer 1

5

I will attempt to sum up the comments to this question and also add my own research into one comprehensive answer.

  1. low_memory option is kind of depricated, as in that it does not actually do anything anymore (source).

  2. memory_map does not seem to use the numpy memory map as far as I can tell from the source code It seems to be an option for how to parse the incoming stream of data, not something that matters for how the dataframe you receive works.

  3. Since my assumption in point 2 is that this is only for parsing, this question is kind of irrelevant.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.