Quantcast
Channel: MATLAB Central Newsreader - tag:"table"
Viewing all articles
Browse latest Browse all 48

Re: efficiency using categorical data

$
0
0
"Yair Altman" wrote in message <ocli7j$k5c$1@newscl01ah.mathworks.com>...
> Categorical data and tables in general use more memory and are less performant than the corresponding implementation using simple arrays. So the actual tradeoff here is not memory vs. performance, but rather maintainability and development time/cost vs. performance.
>
> Yair Altman
> http://UndocumentedMatlab.com
> Author: "Accelerating MATLAB Performance" (CRC Press, 2014)

Why would categorical data use more memory? In my example, I could repeat the char array containing the full path and filename for every row of data that came from that file, but I don't see how that could take less memory than simply storing an index to a list of filenames.

In my case, converting five columns to categoricals reduced the size of the table from 95.4 MB to 8.8 MB.

Viewing all articles
Browse latest Browse all 48

Latest Images

Trending Articles



Latest Images