Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 2505296

Browse files
committed
docs: run the notebook
1 parent c1193d1 commit 2505296

File tree

1 file changed

+64
-9
lines changed

1 file changed

+64
-9
lines changed

notebooks/getting_started/pandas_extensions.ipynb

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Pandas Extension for BigQuery DataFrames\n",
7+
"# BigQuery extension for pandas\n",
88
"\n",
99
"BigQuery DataFrames provides a pandas extension to execute BigQuery SQL scalar functions directly on pandas DataFrames."
1010
]
1111
},
1212
{
1313
"cell_type": "code",
14-
"execution_count": null,
14+
"execution_count": 4,
1515
"metadata": {},
1616
"outputs": [],
1717
"source": [
1818
"import pandas as pd\n",
19-
"import bigframes.pandas as bpd\n",
20-
"import bigframes"
19+
"import bigframes # This import registers the bigquery accessor."
2120
]
2221
},
2322
{
@@ -31,9 +30,37 @@
3130
},
3231
{
3332
"cell_type": "code",
34-
"execution_count": null,
33+
"execution_count": 5,
3534
"metadata": {},
36-
"outputs": [],
35+
"outputs": [
36+
{
37+
"data": {
38+
"text/html": [
39+
"\n",
40+
" Query processed 0 Bytes in a moment of slot time.\n",
41+
" "
42+
],
43+
"text/plain": [
44+
"<IPython.core.display.HTML object>"
45+
]
46+
},
47+
"metadata": {},
48+
"output_type": "display_data"
49+
},
50+
{
51+
"data": {
52+
"text/plain": [
53+
"0 2.0\n",
54+
"1 3.0\n",
55+
"2 4.0\n",
56+
"dtype: Float64"
57+
]
58+
},
59+
"execution_count": 5,
60+
"metadata": {},
61+
"output_type": "execute_result"
62+
}
63+
],
3764
"source": [
3865
"df = pd.DataFrame({\"a\": [1.5, 2.5, 3.5]})\n",
3966
"result = df.bigquery.sql_scalar(\"ROUND({0}, 0)\")\n",
@@ -49,9 +76,37 @@
4976
},
5077
{
5178
"cell_type": "code",
52-
"execution_count": null,
79+
"execution_count": 6,
5380
"metadata": {},
54-
"outputs": [],
81+
"outputs": [
82+
{
83+
"data": {
84+
"text/html": [
85+
"\n",
86+
" Query processed 0 Bytes in a moment of slot time.\n",
87+
" "
88+
],
89+
"text/plain": [
90+
"<IPython.core.display.HTML object>"
91+
]
92+
},
93+
"metadata": {},
94+
"output_type": "display_data"
95+
},
96+
{
97+
"data": {
98+
"text/plain": [
99+
"0 11\n",
100+
"1 22\n",
101+
"2 33\n",
102+
"dtype: Int64"
103+
]
104+
},
105+
"execution_count": 6,
106+
"metadata": {},
107+
"output_type": "execute_result"
108+
}
109+
],
55110
"source": [
56111
"df = pd.DataFrame({\"a\": [1, 2, 3], \"b\": [10, 20, 30]})\n",
57112
"result = df.bigquery.sql_scalar(\"{0} + {1}\")\n",
@@ -61,7 +116,7 @@
61116
],
62117
"metadata": {
63118
"kernelspec": {
64-
"display_name": "Python 3",
119+
"display_name": "venv",
65120
"language": "python",
66121
"name": "python3"
67122
},

0 commit comments

Comments
 (0)