Skip to main content

A wrapper around a Pandas DataFrame which allows you to use the syntax of the Kusto Query Language to transform the DataFrame

Project description

KustoPandas is a wrapper around a Pandas DataFrame which allows you to use the syntax of the Kusto Query Language to transform the data frame. Under the hood the commands are converted to the corresponding Pandas method, so you get all the performance of Pandas, but with the nice syntax of Kusto.

For installation use pip

python -m pip install kusto_pandas

See the following jupyter notebooks for example usage

KustoPandas walkthrough

Trump approval ratings

Here are some very basic usage examples. Please see the walkthrough above for more details.

import pandas as pd
from kusto_pandas import Wrap
dataframe = pd.read_csv("data.csv")
w = Wrap(dataframe)

w.where("Column1 > 0").summarize("count(), AvgOfCol1 = avg(Column1) by Column2")

In the above, multiple tabular operators are chained together, however if you prefer you can enter the full Kusto query

w.execute("""
w
| where Column1 > 0
| summarize count(), AvgOfCol1 = avg(Column1) by Column2
""")

If you are working in a Jupyter notebook, then you may find it more convenient to use an IPython magic

Kusto magic impage

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kusto_pandas-0.1.0.tar.gz (32.0 kB view hashes)

Uploaded Source

Built Distribution

kusto_pandas-0.1.0-py3-none-any.whl (37.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page