Reduce the pandas dataframe size automatically.
This is the test perform on Jena dataset.
OS X , Windows & Linux:
pip install downcast
This package is used the reduce the dataframe size without affecting the values. It find the max and min value in dataframe columns, based on these values it downcast the datatypes of that columns.
from downcast import reduce
import pandas as pd
# load your dataframe
df = pd.read_csv("PATH")
# reduce the size of dataframe
df = reduce(df)
For local development setup
git clone https://github.com/deepak7376/downcast
cd downcast
pip install -r requirements.txt
- 0.0.8
- CHANGE: added downloads stats
- 0.0.7
- CHANGE: Readme fixed
- 0.0.6
- CHANGE: Tested version
- 0.0.5
- CHANGE: work in progress
Deepak Yadav – @imdeepak_dky – dky.united@gmail.com
Distributed under the MIT license. See LICENSE
for more information.
https://github.com/deepak7376/downcast/blob/master/LICENSE
- Fork it (https://github.com/deepak7376/downcast/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
https://www.kaggle.com/anshuls235/time-series-forecasting-eda-fe-modelling