@@ -25,6 +25,7 @@ Contributors
25
25
* `@henhuy <https://github.com/henhuy >`_
26
26
* `Hélio Meira Lins <https://github.com/meiralins >`_
27
27
* `@utpyngo <https://github.com/utpyngo >`_
28
+ * `William Schwartz <https://github.com/wkschwartz >`_
28
29
29
30
What's New
30
31
===========
@@ -119,6 +120,23 @@ read_frame
119
120
human readable versions of any foreign key or choice fields
120
121
else use the actual values set in the model.
121
122
123
+ - compress: a false value, ``True ``, or a mapping, default False
124
+ If a true value, infer `NumPy data types
125
+ <https://docs.scipy.org/doc/numpy/user/basics.types.html> `_ for
126
+ Pandas dataframe columns from the corresponding Django field
127
+ types. For example, Django's built in ``SmallIntgerField `` is
128
+ cast to NumPy's ``int16 ``. If ``compress `` is a mapping (e.g., a
129
+ ``dict ``), it should be a mapping with Django field subclasses
130
+ as keys and `NumPy dtypes
131
+ <https://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html> `_
132
+ as values. This mapping overrides the defualts for the field
133
+ classes appearing in the mapping. However, the inference is
134
+ based on the field subclass lowest on a chain of subclasses,
135
+ that is, in order of inheritence. To override
136
+ ``SmallIntegerField `` it is therefore not sufficient to override
137
+ ``IntegerField ``. Careful of setting ``compress={} `` because
138
+ ``{} `` is a false value in Python, which would cause
139
+ ``read_frame `` not to compress columns.
122
140
123
141
Examples
124
142
^^^^^^^^^
0 commit comments