A light weight tool for creating summary statistics from dataframes.
skimpy is a light weight tool that provides summary statistics about variables in data frames within the console or your interactive Python window. Think of it as a super-charged version of df.describe().
[You can find the full documentation here](https://aeturrell.github.io/skimpy/).
Quickstart
skim a dataframe and produce summary statistics within the console using:
from skimpy import skimskim(df)
where df is a dataframe.
If you need to a dataset to try skimpy out on, you can use the built-in test dataframe:
It is recommended that you set your datatypes before using skimpy (for example converting any text columns to pandas string datatype), as this will produce richer statistical summaries. However, the skim function will try and guess what the datatypes of your columns are.
skimpy also comes with a clean_columns function as a convenience. This slugifies column names. For example,
import pandas as pdfrom rich importprintfrom skimpy import clean_columnscolumns = ["bs lncs;n edbn ","Nín hǎo. Wǒ shì zhōng guó rén","___This is a test___","ÜBER Über German Umlaut",]messy_df = pd.DataFrame(columns=columns, index=[0], data=[range(len(columns))])messy_df.head()
bs lncs;n edbn
Nín hǎo. Wǒ shì zhōng guó rén
___This is a test___
ÜBER Über German Umlaut
0
0
1
2
3
Now let’s clean these—by default what we get back is in snake case:
You can find a full list of requirements in the pyproject.toml file. The main requirements are:
python >=3.7.1,<4.0.0
click 7.1.2
rich ^10.9.0
pandas ^1.3.2
Pygments ^2.10.0
typeguard ^2.12.1
You can try this package out right now in your browser using this Google Colab notebook (requires a Google account). Note that the Google Colab notebook uses the latest package released on PyPI (rather than the development release).
Installation
You can install the latest release of skimpy via pip from PyPI:
Contributions are very welcome. To learn more, see the Contributor Guide.
Note that you will need Quarto and Make installed to build the docs. You can preview the docs using poetry run quarto preview --execute. You can build them with make.
License
Distributed under the terms of the MIT license, skimpy is free and open source software. You can find the license here
Issues
If you encounter any problems, please file an issue along with a detailed description.
skimpy was inspired by the R package skimr and by exploratory Python packages including pandas_profiling and dataprep, from which the clean_columns function comes.
The package is built with poetry, while the documentation is built with Quarto. Tests are run with nox.