kusto-pandas

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


License
MIT
Install
pip install kusto-pandas==0.1.0

Documentation

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 kusto-pandas on pypi

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