diff --git a/docs/_freeze/posts/walking-talking-cube/index/execute-results/html.json b/docs/_freeze/posts/walking-talking-cube/index/execute-results/html.json new file mode 100644 index 000000000000..e355e47a86b1 --- /dev/null +++ b/docs/_freeze/posts/walking-talking-cube/index/execute-results/html.json @@ -0,0 +1,16 @@ +{ + "hash": "db88c501535c5068b03c526d267552e4", + "result": { + "engine": "jupyter", + "markdown": "---\ntitle: \"Taking a random cube for a walk and making it talk\"\nauthor: \"Cody Peterson\"\ndate: \"2024-09-26\"\nimage: thumbnail.png\ncategories:\n - blog\n - duckdb\n - udfs\n---\n\n***Synthetic data with Ibis, DuckDB, Python UDFs, and Faker.***\n\nTo follow along, install the required libraries:\n\n```bash\npip install 'ibis-framework[duckdb]' faker plotly\n```\n\n## A random cube\n\nWe'll generate a random cube of data with Ibis (default DuckDB backend) and\nvisualize it as a 3D line plot:\n\n::: {#0daf46ce .cell execution_count=2}\n``` {.python .cell-code code-fold=\"true\" code-summary=\"Show me the code!\"}\nimport ibis # <1>\nimport ibis.selectors as s\nimport plotly.express as px # <1>\n\nibis.options.interactive = True # <2>\nibis.options.repr.interactive.max_rows = 5 # <2>\n\ncon = ibis.connect(\"duckdb://synthetic.ddb\") # <3>\n\nif \"source\" in con.list_tables():\n t = con.table(\"source\") # <4>\nelse:\n lookback = ibis.interval(days=1) # <5>\n step = ibis.interval(seconds=1) # <5>\n\n t = (\n (\n ibis.range( # <6>\n ibis.now() - lookback,\n ibis.now(),\n step=step,\n ) # <6>\n .unnest() # <7>\n .name(\"timestamp\") # <8>\n .as_table() # <9>\n )\n .mutate(\n index=(ibis.row_number().over(order_by=\"timestamp\")), # <10>\n **{col: 2 * (ibis.random() - 0.5) for col in [\"a\", \"b\", \"c\"]}, # <11>\n )\n .mutate(color=ibis._[\"index\"].histogram(nbins=8)) # <12>\n .drop(\"index\") # <13>\n .relocate(\"timestamp\", \"color\") # <14>\n .order_by(\"timestamp\") # <15>\n )\n\n t = con.create_table(\"source\", t.to_pyarrow()) # <16>\n\nc = px.line_3d( # <17>\n t,\n x=\"a\",\n y=\"b\",\n z=\"c\",\n color=\"color\",\n hover_data=[\"timestamp\"],\n) # <17>\nc\n```\n\n::: {.cell-output .cell-output-display}\n```{=html}\n