Agent creating notebooks
Describe the analysis, and the assistant writes the notebook, runs each cell on this computer, and fixes what fails until the notebook runs from top to bottom. Here it finds violent crime hot spots in Dallas with crimepy's weighted DBSCAN, from the copy of the city's open data that comes with crimepy, and maps them in crimepy's style.
1. Let the assistant run Python
In the project, press Sandbox locked. Turn on Assistant-run Python, so it can run what it writes, and Accept assistant edits automatically, so its notebook is saved as it goes.
Expand2. Ask for the notebook
Say what the notebook should do, from which data, and where to save it. Here: "Make a new notebook, maps/violent-hotspots.ipynb, that finds hot spots of assaults and robberies in crimepy's Dallas data with weighted DBSCAN (a robbery counts 2, an assault 1), lists them in a table, and maps them on an interactive map in crimepy's style with each hot spot's counts in its popup. Then run it." The crime analysis skill gives it crimepy's method.
Expand3. Read what it did
It writes the notebook, runs it, and says what it found and which settings it used: here the distance and the smallest weight a hot spot needs.
Expand4. Open the notebook
Press the notebook in the Explorer. Each cell keeps its output, and you can change and run any cell yourself, or ask the assistant to.
Expand5. The map
The hot spots are on crimepy's map, with the layer control open as the legend. Click a hot spot to see its counts.
ExpandGood to know
- Each run is a little different: the assistant writes its own code each time, so its cells and numbers will differ from these.
- Everything runs on this computer, in the app's sandbox, with no network. The data comes with crimepy, so the notebook needs no download.
- A weight changes what a hot spot needs: here 200 means a weight of at least 200 within the distance, so 100 robberies count as much as 200 assaults.
- The crimes are from the City of Dallas's open data, as crimepy carries them.