This is in keeping with the philosophy behind Pandas and NumPy - by using strict types (instead of normal Python 'duck typing'), you can do things a lot faster. Here's a trick that came in handy!īy default, if you read a DataFrame from a file, it'll cast all the numerical columns as the float64 type.
Recently, I had to find a way to reduce the memory footprint of a Pandas DataFrame in order to actually do operations on it.