3 ms·
If you'd use a column-oriented format like {"col1":["a","b","c",...],"col2":[1,2,3...],...}, it's about the same density, no?
by quantumofalpha 5y ago
If you'd use a column-oriented format like {"col1":["a","b","c",...],"col2":[1,2,3...],...}, it's about the same density, no?
- rahimnathwani 5y agoThis is the default format used by pandas.DataFrame.to_dict() I usually need a less dense version, e.g. to send to a jinja2 template, so mostly use to_dict(orient='index').