Skip to contentDockly One

Code

From a sentenceto code that runs.

Say what the script should do. Dockly AI writes it, explains each step in plain language, and fixes it with you when the data turns out to be messier than expected.

Your request (input)

total monthly utility cost per site, from a csv

Code (output)
import pandas as pd

df = pd.read_csv('utility.csv')
df = df.dropna(subset=['cost'])
monthly = df.groupby(['site',
    df['month']])['cost'].sum()

print(monthly.unstack())

More examples

See more examples
Sentence to ScriptA working file, not a snippet.
Error to FixPaste the traceback, get the cause.
Code to ExplanationWhat this does, line by line.
Query to SQLAsk in English, read it in SQL.