Open
Description
openedon Mar 26, 2021
In Jupyter Lab I have seattle-weather.csv, bar.vl.json and a notebook all in the same folder. The data is from the example data sets, as is the Vega Lite:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"url": "seattle-weather.csv"},
"mark": "bar",
"encoding": {
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"},
"y": {"aggregate": "count", "type": "quantitative"},
"color": {"field": "weather", "type": "nominal"}
}
}
Opening the Vega Lite file directly creates a tab with the bar chart rendered as expected. In the notebook I need to pass the full URL to Altair to create the same visualisation:
alt.Chart('http://localhost:8888/files/seattle-weather.csv').mark_bar().encode(
x='month(date):O',
y='count():Q',
color='weather:N'
)
Why does alt.Chart('seattle-weather.csv').....
not work in the notebook? Can the docs be updated to include guidance around this use case scenario?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment