In [1]:
import jupyterviz
In [2]:
import pandas as pd
In [3]:
df = pd.read_csv("data/cities.csv")
In [4]:
#jupyterviz.serve(df)
In [5]:
jupyterviz.viz(type="vegalite",data=df.to_dict(orient="records"),spec={
"data": {"url": "https://localhost:8090/api/db","formatType": "json"},
"transform": {},
"mark": "bar",
"encoding": {
"x": {"field": "country","type": "nominal"},
"y": {"aggregate": "count","field": "*","type": "quantitative"}
}
})
Out[5]:
In [ ]: