October 2017
Intermediate to advanced
532 pages
16h 10m
English
Pandas defaults integer and float data types to 64 bits regardless of the maximum necessary size for the particular DataFrame. Integers, floats, and even booleans may be coerced to a different data type with the astype method and passing it the exact type, either as a string or specific object, as done in step 4.
The RELAFFIL column is a good choice to cast to a smaller integer type as the data dictionary explains that its values must be 0/1. The memory for RELAFFIL is now an eighth of CURROPER, which remains as its former type.
Read now
Unlock full access