diff --git a/packages/bigframes/notebooks/dataframes/magics_with_local_data.ipynb b/packages/bigframes/notebooks/dataframes/magics_with_local_data.ipynb new file mode 100644 index 000000000000..a008b011f1dc --- /dev/null +++ b/packages/bigframes/notebooks/dataframes/magics_with_local_data.ipynb @@ -0,0 +1,1777 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "c5f9e86e", + "metadata": {}, + "outputs": [], + "source": [ + "# Copyright 2026 Google LLC\n", + "#\n", + "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", + "# you may not use this file except in compliance with the License.\n", + "# You may obtain a copy of the License at\n", + "#\n", + "# https://www.apache.org/licenses/LICENSE-2.0\n", + "#\n", + "# Unless required by applicable law or agreed to in writing, software\n", + "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", + "# See the License for the specific language governing permissions and\n", + "# limitations under the License." + ] + }, + { + "cell_type": "markdown", + "id": "71383fa0", + "metadata": {}, + "source": [ + "# Query `*.xlsx` files with SQL for free\\* using Pandas and BigQuery DataFrames\n", + "\n", + "In this tutorial, you'll use SQL query the [USDA wheat data](https://www.ers.usda.gov/data-products/wheat-data), which is distributed as files in the [Excel (.xlsx) Extensions to the Office Open XML SpreadsheetML file format](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-xlsx/2c5dee00-eff2-4b22-92b6-0738acd4475e). Because of open source packages like Jupyter, Pandas, and BigQuery DataFrames (aka BigFrames) and the [BigQuery sandbox](https://docs.cloud.google.com/bigquery/docs/sandbox), you should be able to follow all of the steps in this guide for free\\* and without a credit card. \n", + "\n", + "_\\*See the [BigQuery sandbox](https://docs.cloud.google.com/bigquery/docs/sandbox) documentation for limitations._\n", + "\n", + "BigQuery DataFrames aka BigFrames is an open source Python library offered by Google. BigFrames scales Python data processing by transpiling common Python data science APIs to BigQuery SQL. You can read more about BigFrames in the [official introduction to BigFrames](https://dataframes.bigquery.dev/user_guide/index.html) and can refer to the [public git repository for BigFrames](https://github.com/googleapis/google-cloud-python/tree/main/packages/bigframes).\n", + "\n", + "Last year, Google introduced [SQL cells in Colab Enterprise notebooks](https://docs.cloud.google.com/colab/docs/sql-cells), which was a collaboration across several teams, including the BigQuery DataFrames team. Now, with the [%%bqsql cell magics](https://dataframes.bigquery.dev/notebooks/getting_started/magics.html) available in BigQuery DataFrames (aka BigFrames), this same functionality is available to all Jupyter notebook users, whether you're in Colab, Jupyter Lab, or a notebook in VS Code. These magics use BigQuery to query a table or even a local pandas DataFrame.\n", + "\n", + "\n", + "# Getting Started\n", + "\n", + "To get started,\n", + "\n", + "1. Enable the [BigQuery sandbox](https://docs.cloud.google.com/bigquery/docs/sandbox). Make note of your Google Cloud project ID.\n", + "\n", + "2. Set up a local Python development environment (see: [Setting up a Python development environment](https://docs.cloud.google.com/python/docs/setup)) for Google Cloud.\n", + "\n", + "3. Create and activate a venv to isolate Python dependencies. \\\n", + " \\\n", + "On Linux or macOS, use these commands (update to your preferred Python version): \\\n", + "\n", + "\n", + "\n", + "```\n", + "python3.12 -m venv ~/venv\n", + ". ~/venv/bin/activate\n", + "```\n", + "\n", + "\n", + "4. Install the Jupyter, bigframes, and python-calamine packages \\\n", + "\n", + "\n", + "\n", + "```\n", + "pip install --upgrade jupyterlab bigframes python-calamine\n", + "```\n", + "\n", + "\n", + "5. Start Jupyter Lab.\n", + "\n", + "\n", + "```\n", + "jupyter lab\n", + "```\n", + "\n", + "\n", + "6. Open a web browser to the URL listed in the output. It will be something like http://localhost:8888/lab?token=somesupersecretvaluehere .\n", + "\n", + "7. Create a new notebook using the Jupyter Lab UI.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "d00aeb28", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: python-calamine in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (0.6.2)\n", + "Requirement already satisfied: pandas in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (3.0.2)\n", + "Requirement already satisfied: bigframes in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (2.39.0)\n", + "Requirement already satisfied: numpy>=2.3.3 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pandas) (2.4.4)\n", + "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pandas) (2.9.0.post0)\n", + "Requirement already satisfied: cloudpickle>=2.0.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (3.1.2)\n", + "Requirement already satisfied: fsspec>=2023.3.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (2026.1.0)\n", + "Requirement already satisfied: gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (2026.1.0)\n", + "Requirement already satisfied: geopandas>=0.12.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (1.1.3)\n", + "Requirement already satisfied: google-auth<3.0,>=2.15.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (2.49.1)\n", + "Requirement already satisfied: google-cloud-bigquery>=3.36.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-cloud-bigquery[bqstorage,pandas]>=3.36.0->bigframes) (3.41.0)\n", + "Requirement already satisfied: google-cloud-bigquery-storage<3.0.0,>=2.30.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (2.37.0)\n", + "Requirement already satisfied: google-cloud-functions>=1.12.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (1.23.0)\n", + "Requirement already satisfied: google-cloud-bigquery-connection>=1.12.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (1.21.0)\n", + "Requirement already satisfied: google-cloud-resource-manager>=1.10.3 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (1.17.0)\n", + "Requirement already satisfied: google-cloud-storage>=2.0.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (3.10.1)\n", + "Requirement already satisfied: google-crc32c<2.0.0,>=1.0.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (1.8.0)\n", + "Requirement already satisfied: grpc-google-iam-v1>=0.14.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (0.14.4)\n", + "Requirement already satisfied: pandas-gbq>=0.26.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (0.34.1)\n", + "Requirement already satisfied: pyarrow>=15.0.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (23.0.1)\n", + "Requirement already satisfied: pydata-google-auth>=1.8.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (1.9.1)\n", + "Requirement already satisfied: requests>=2.27.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (2.33.1)\n", + "Requirement already satisfied: shapely>=1.8.5 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (2.1.2)\n", + "Requirement already satisfied: tabulate>=0.9 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (0.10.0)\n", + "Requirement already satisfied: humanize>=4.6.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (4.15.0)\n", + "Requirement already satisfied: matplotlib>=3.7.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (3.10.8)\n", + "Requirement already satisfied: db-dtypes>=1.4.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (1.5.1)\n", + "Requirement already satisfied: pyiceberg>=0.7.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (0.11.1)\n", + "Requirement already satisfied: atpublic<6,>=2.3 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (5.1)\n", + "Requirement already satisfied: pytz>=2022.7 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (2026.1.post1)\n", + "Requirement already satisfied: toolz<2,>=0.11 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (1.1.0)\n", + "Requirement already satisfied: typing-extensions<5,>=4.5.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (4.15.0)\n", + "Requirement already satisfied: rich<14,>=12.4.4 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from bigframes) (13.9.4)\n", + "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-auth<3.0,>=2.15.0->bigframes) (0.4.2)\n", + "Requirement already satisfied: cryptography>=38.0.3 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-auth<3.0,>=2.15.0->bigframes) (46.0.6)\n", + "Requirement already satisfied: google-api-core<3.0.0,>=2.11.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-api-core[grpc]<3.0.0,>=2.11.0->google-cloud-bigquery-storage<3.0.0,>=2.30.0->bigframes) (2.30.2)\n", + "Requirement already satisfied: grpcio<2.0.0,>=1.33.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-cloud-bigquery-storage<3.0.0,>=2.30.0->bigframes) (1.80.0)\n", + "Requirement already satisfied: proto-plus<2.0.0,>=1.22.3 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-cloud-bigquery-storage<3.0.0,>=2.30.0->bigframes) (1.27.2)\n", + "Requirement already satisfied: protobuf<8.0.0,>=4.25.8 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-cloud-bigquery-storage<3.0.0,>=2.30.0->bigframes) (6.33.6)\n", + "Requirement already satisfied: googleapis-common-protos<2.0.0,>=1.63.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-api-core<3.0.0,>=2.11.0->google-api-core[grpc]<3.0.0,>=2.11.0->google-cloud-bigquery-storage<3.0.0,>=2.30.0->bigframes) (1.74.0)\n", + "Requirement already satisfied: grpcio-status<2.0.0,>=1.33.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-api-core[grpc]<3.0.0,>=2.11.0->google-cloud-bigquery-storage<3.0.0,>=2.30.0->bigframes) (1.80.0)\n", + "Requirement already satisfied: six>=1.5 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from python-dateutil>=2.8.2->pandas) (1.17.0)\n", + "Requirement already satisfied: charset_normalizer<4,>=2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from requests>=2.27.1->bigframes) (3.4.7)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from requests>=2.27.1->bigframes) (3.11)\n", + "Requirement already satisfied: urllib3<3,>=1.26 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from requests>=2.27.1->bigframes) (2.6.3)\n", + "Requirement already satisfied: certifi>=2023.5.7 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from requests>=2.27.1->bigframes) (2026.2.25)\n", + "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from rich<14,>=12.4.4->bigframes) (4.0.0)\n", + "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from rich<14,>=12.4.4->bigframes) (2.20.0)\n", + "Requirement already satisfied: cffi>=2.0.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from cryptography>=38.0.3->google-auth<3.0,>=2.15.0->bigframes) (2.0.0)\n", + "Requirement already satisfied: pycparser in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from cffi>=2.0.0->cryptography>=38.0.3->google-auth<3.0,>=2.15.0->bigframes) (3.0)\n", + "Requirement already satisfied: packaging>=24.2.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from db-dtypes>=1.4.2->bigframes) (26.0)\n", + "\u001b[33mWARNING: Cache entry deserialization failed, entry ignored\u001b[0m\u001b[33m\n", + "\u001b[0mCollecting pandas\n", + " Using cached pandas-2.3.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (91 kB)\n", + "Requirement already satisfied: tzdata>=2022.7 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pandas) (2026.1)\n", + "Requirement already satisfied: aiohttp!=4.0.0a0,!=4.0.0a1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (3.13.5)\n", + "Requirement already satisfied: decorator>4.1.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (5.2.1)\n", + "Requirement already satisfied: google-auth-oauthlib in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (1.3.1)\n", + "Requirement already satisfied: google-cloud-storage-control in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (1.11.0)\n", + "Requirement already satisfied: aiohappyeyeballs>=2.5.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (2.6.1)\n", + "Requirement already satisfied: aiosignal>=1.4.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (1.4.0)\n", + "Requirement already satisfied: attrs>=17.3.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (26.1.0)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (1.8.0)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (6.7.1)\n", + "Requirement already satisfied: propcache>=0.2.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (0.4.1)\n", + "Requirement already satisfied: yarl<2.0,>=1.17.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (1.23.0)\n", + "Requirement already satisfied: pyogrio>=0.7.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from geopandas>=0.12.2->bigframes) (0.12.1)\n", + "Requirement already satisfied: pyproj>=3.5.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from geopandas>=0.12.2->bigframes) (3.7.2)\n", + "Requirement already satisfied: google-cloud-core<3.0.0,>=2.4.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-cloud-bigquery>=3.36.0->google-cloud-bigquery[bqstorage,pandas]>=3.36.0->bigframes) (2.5.1)\n", + "Requirement already satisfied: google-resumable-media<3.0.0,>=2.0.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-cloud-bigquery>=3.36.0->google-cloud-bigquery[bqstorage,pandas]>=3.36.0->bigframes) (2.8.2)\n", + "Requirement already satisfied: mdurl~=0.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from markdown-it-py>=2.2.0->rich<14,>=12.4.4->bigframes) (0.1.2)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from matplotlib>=3.7.1->bigframes) (1.3.3)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from matplotlib>=3.7.1->bigframes) (0.12.1)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from matplotlib>=3.7.1->bigframes) (4.62.1)\n", + "Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from matplotlib>=3.7.1->bigframes) (1.5.0)\n", + "Requirement already satisfied: pillow>=8 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from matplotlib>=3.7.1->bigframes) (12.2.0)\n", + "Requirement already satisfied: pyparsing>=3 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from matplotlib>=3.7.1->bigframes) (3.3.2)\n", + "Requirement already satisfied: setuptools in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pandas-gbq>=0.26.1->bigframes) (82.0.1)\n", + "Requirement already satisfied: psutil>=5.9.8 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pandas-gbq>=0.26.1->bigframes) (7.2.2)\n", + "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from google-auth-oauthlib->gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (2.0.0)\n", + "Requirement already satisfied: pyasn1<0.7.0,>=0.6.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pyasn1-modules>=0.2.1->google-auth<3.0,>=2.15.0->bigframes) (0.6.3)\n", + "Requirement already satisfied: mmh3<6.0.0,>=4.0.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pyiceberg>=0.7.1->bigframes) (5.2.1)\n", + "Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pyiceberg>=0.7.1->bigframes) (8.3.2)\n", + "Requirement already satisfied: strictyaml<2.0.0,>=1.7.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pyiceberg>=0.7.1->bigframes) (1.7.3)\n", + "Requirement already satisfied: pydantic!=2.12.0,!=2.12.1,!=2.4.0,!=2.4.1,<3.0,>=2.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pyiceberg>=0.7.1->bigframes) (2.12.5)\n", + "Requirement already satisfied: tenacity<10.0.0,>=8.2.3 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pyiceberg>=0.7.1->bigframes) (9.1.4)\n", + "Requirement already satisfied: pyroaring<2.0.0,>=1.0.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pyiceberg>=0.7.1->bigframes) (1.0.4)\n", + "Requirement already satisfied: cachetools<7.0,>=5.5 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pyiceberg>=0.7.1->bigframes) (6.2.6)\n", + "Requirement already satisfied: zstandard<1.0.0,>=0.13.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pyiceberg>=0.7.1->bigframes) (0.25.0)\n", + "Requirement already satisfied: annotated-types>=0.6.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pydantic!=2.12.0,!=2.12.1,!=2.4.0,!=2.4.1,<3.0,>=2.0->pyiceberg>=0.7.1->bigframes) (0.7.0)\n", + "Requirement already satisfied: pydantic-core==2.41.5 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pydantic!=2.12.0,!=2.12.1,!=2.4.0,!=2.4.1,<3.0,>=2.0->pyiceberg>=0.7.1->bigframes) (2.41.5)\n", + "Requirement already satisfied: typing-inspection>=0.4.2 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from pydantic!=2.12.0,!=2.12.1,!=2.4.0,!=2.4.1,<3.0,>=2.0->pyiceberg>=0.7.1->bigframes) (0.4.2)\n", + "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/google/home/swast/src/github.com/googleapis/google-cloud-python/packages/bigframes/venv/lib/python3.14/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib->gcsfs!=2025.5.0,!=2026.2.0,!=2026.3.0,>=2023.3.0->bigframes) (3.3.1)\n", + "Using cached pandas-2.3.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (12.3 MB)\n", + "Installing collected packages: pandas\n", + " Attempting uninstall: pandas\n", + " Found existing installation: pandas 3.0.2\n", + " Uninstalling pandas-3.0.2:\n", + " Successfully uninstalled pandas-3.0.2\n", + "Successfully installed pandas-2.3.3\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], + "source": [ + "%pip install python-calamine pandas bigframes" + ] + }, + { + "cell_type": "markdown", + "id": "5ba39d0d", + "metadata": {}, + "source": [ + "## Accessing the data\n", + "\n", + "In this tutorial, you'll analyze the [USDA wheat data](https://www.ers.usda.gov/data-products/wheat-data). Use the requests package to download the data to a temporary file." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "fb1dfdc2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "\n", + "import tempfile\n", + "\n", + "import requests\n", + "\n", + "url = \"https://www.ers.usda.gov/media/5706/wheat-data-all-years.xlsx?v=52690\"\n", + "\n", + "tmp = tempfile.NamedTemporaryFile(delete=True)\n", + "\n", + "with requests.get(url, stream=True) as r:\n", + " r.raise_for_status()\n", + " for chunk in r.iter_content(chunk_size=8192):\n", + " tmp.write(chunk)\n", + "\n", + "tmp.flush()\n", + "tmp.seek(0)" + ] + }, + { + "cell_type": "markdown", + "id": "50f896bb", + "metadata": {}, + "source": [ + "\n", + "When working with SQL, use the pyarrow dtype_backend for more consistent handling of NULL values. The Table05 sheet provides annual data:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "8a8a137b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
| \n", + " | Marketing year 1/ | \n", + "Time period | \n", + "Beginning stocks | \n", + "Production | \n", + "Imports 2/ | \n", + "Total supply 3/ | \n", + "Food use | \n", + "Seed use | \n", + "Feed and residual use | \n", + "Total domestic use 3/ | \n", + "Exports 2/ | \n", + "Total disappearance 3/ | \n", + "Ending stocks | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", + "1950/51 | \n", + "MY Jun-May | \n", + "496.0 | \n", + "1019.0 | \n", + "11.0 | \n", + "1526.0 | \n", + "580.0 | \n", + "-- | \n", + "109.0 | \n", + "689.0 | \n", + "345.0 | \n", + "1034.0 | \n", + "492.0 | \n", + "
| 1 | \n", + "1951/52 | \n", + "MY Jun-May | \n", + "492.0 | \n", + "988.0 | \n", + "30.0 | \n", + "1510.0 | \n", + "585.0 | \n", + "-- | \n", + "110.0 | \n", + "695.0 | \n", + "485.0 | \n", + "1180.0 | \n", + "330.0 | \n", + "
| 2 | \n", + "1952/53 | \n", + "MY Jun-May | \n", + "330.0 | \n", + "1306.0 | \n", + "24.0 | \n", + "1660.0 | \n", + "578.0 | \n", + "-- | \n", + "78.0 | \n", + "656.0 | \n", + "332.0 | \n", + "988.0 | \n", + "672.0 | \n", + "
| 3 | \n", + "1953/54 | \n", + "MY Jun-May | \n", + "672.0 | \n", + "1173.0 | \n", + "6.0 | \n", + "1851.0 | \n", + "556.0 | \n", + "-- | \n", + "87.0 | \n", + "643.0 | \n", + "214.0 | \n", + "857.0 | \n", + "994.0 | \n", + "
| 4 | \n", + "1954/55 | \n", + "MY Jun-May | \n", + "994.0 | \n", + "984.0 | \n", + "3.0 | \n", + "1981.0 | \n", + "552.0 | \n", + "-- | \n", + "53.0 | \n", + "605.0 | \n", + "267.0 | \n", + "872.0 | \n", + "1109.0 | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| 281 | \n", + "1/ June–May. Latest data may be preliminary or... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 282 | \n", + "2/ Includes flour and selected other products ... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 283 | \n", + "3/ Totals may not add due to rounding. | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 284 | \n", + "Source: USDA, Economic Research Service, based... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 285 | \n", + "Updated: May 12, 2026 | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
286 rows × 13 columns
\n", + "| \n", + " | Marketing year 1 | \n", + "Time period | \n", + "Beginning stocks | \n", + "Production | \n", + "Imports 2 | \n", + "Total supply 3 | \n", + "Food use | \n", + "Seed use | \n", + "Feed and residual use | \n", + "Total domestic use 3 | \n", + "Exports 2 | \n", + "Total disappearance 3 | \n", + "Ending stocks | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", + "1950/51 | \n", + "MY Jun-May | \n", + "496.0 | \n", + "1019.0 | \n", + "11.0 | \n", + "1526.0 | \n", + "580.0 | \n", + "-- | \n", + "109.0 | \n", + "689.0 | \n", + "345.0 | \n", + "1034.0 | \n", + "492.0 | \n", + "
| 1 | \n", + "1951/52 | \n", + "MY Jun-May | \n", + "492.0 | \n", + "988.0 | \n", + "30.0 | \n", + "1510.0 | \n", + "585.0 | \n", + "-- | \n", + "110.0 | \n", + "695.0 | \n", + "485.0 | \n", + "1180.0 | \n", + "330.0 | \n", + "
| 2 | \n", + "1952/53 | \n", + "MY Jun-May | \n", + "330.0 | \n", + "1306.0 | \n", + "24.0 | \n", + "1660.0 | \n", + "578.0 | \n", + "-- | \n", + "78.0 | \n", + "656.0 | \n", + "332.0 | \n", + "988.0 | \n", + "672.0 | \n", + "
| 3 | \n", + "1953/54 | \n", + "MY Jun-May | \n", + "672.0 | \n", + "1173.0 | \n", + "6.0 | \n", + "1851.0 | \n", + "556.0 | \n", + "-- | \n", + "87.0 | \n", + "643.0 | \n", + "214.0 | \n", + "857.0 | \n", + "994.0 | \n", + "
| 4 | \n", + "1954/55 | \n", + "MY Jun-May | \n", + "994.0 | \n", + "984.0 | \n", + "3.0 | \n", + "1981.0 | \n", + "552.0 | \n", + "-- | \n", + "53.0 | \n", + "605.0 | \n", + "267.0 | \n", + "872.0 | \n", + "1109.0 | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| 281 | \n", + "1/ June–May. Latest data may be preliminary or... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 282 | \n", + "2/ Includes flour and selected other products ... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 283 | \n", + "3/ Totals may not add due to rounding. | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 284 | \n", + "Source: USDA, Economic Research Service, based... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 285 | \n", + "Updated: May 12, 2026 | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
286 rows × 13 columns
\n", + "| \n", + " | Marketing year 1/ | \n", + "Type 2/ | \n", + "Beginning stocks | \n", + "Production | \n", + "Imports | \n", + "Total supply 3/ 4/ | \n", + "Food use | \n", + "Seed use | \n", + "Feed and residual use | \n", + "Total domestic use 4/ | \n", + "Exports | \n", + "Total disappearance 4/ | \n", + "Ending stocks | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", + "1950/51 | \n", + "All wheat | \n", + "496.0 | \n", + "1019.0 | \n", + "11 | \n", + "1526.0 | \n", + "580.0 | \n", + "-- | \n", + "109.0 | \n", + "689.0 | \n", + "345.0 | \n", + "1034.0 | \n", + "492.0 | \n", + "
| 1 | \n", + "1951/52 | \n", + "All wheat | \n", + "492.0 | \n", + "988.0 | \n", + "30 | \n", + "1510.0 | \n", + "585.0 | \n", + "-- | \n", + "110.0 | \n", + "695.0 | \n", + "485.0 | \n", + "1180.0 | \n", + "330.0 | \n", + "
| 2 | \n", + "1952/53 | \n", + "All wheat | \n", + "330.0 | \n", + "1306.0 | \n", + "24 | \n", + "1660.0 | \n", + "578.0 | \n", + "-- | \n", + "78.0 | \n", + "656.0 | \n", + "332.0 | \n", + "988.0 | \n", + "672.0 | \n", + "
| 3 | \n", + "1953/54 | \n", + "All wheat | \n", + "672.0 | \n", + "1173.0 | \n", + "6 | \n", + "1851.0 | \n", + "556.0 | \n", + "-- | \n", + "87.0 | \n", + "643.0 | \n", + "214.0 | \n", + "857.0 | \n", + "994.0 | \n", + "
| 4 | \n", + "1954/55 | \n", + "All wheat | \n", + "994.0 | \n", + "984.0 | \n", + "3 | \n", + "1981.0 | \n", + "552.0 | \n", + "-- | \n", + "53.0 | \n", + "605.0 | \n", + "267.0 | \n", + "872.0 | \n", + "1109.0 | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| 287 | \n", + "2/ Hard Red Winter, Hard Red Spring, Soft Red ... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 288 | \n", + "3/ Includes flour and selected other products ... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 289 | \n", + "4/ Totals may not add due to rounding. | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 290 | \n", + "Source: USDA, Economic Research Service, based... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 291 | \n", + "Updated: April 10, 2026 | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
292 rows × 13 columns
\n", + "| \n", + " | Marketing year 1 | \n", + "Type 2 | \n", + "Beginning stocks | \n", + "Production | \n", + "Imports | \n", + "Total supply 3 4 | \n", + "Food use | \n", + "Seed use | \n", + "Feed and residual use | \n", + "Total domestic use 4 | \n", + "Exports | \n", + "Total disappearance 4 | \n", + "Ending stocks | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| rowindex | \n", + "\n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " |
| 0 | \n", + "1950/51 | \n", + "All wheat | \n", + "496.0 | \n", + "1019.0 | \n", + "11 | \n", + "1526.0 | \n", + "580.0 | \n", + "-- | \n", + "109.0 | \n", + "689.0 | \n", + "345.0 | \n", + "1034.0 | \n", + "492.0 | \n", + "
| 1 | \n", + "1951/52 | \n", + "All wheat | \n", + "492.0 | \n", + "988.0 | \n", + "30 | \n", + "1510.0 | \n", + "585.0 | \n", + "-- | \n", + "110.0 | \n", + "695.0 | \n", + "485.0 | \n", + "1180.0 | \n", + "330.0 | \n", + "
| 2 | \n", + "1952/53 | \n", + "All wheat | \n", + "330.0 | \n", + "1306.0 | \n", + "24 | \n", + "1660.0 | \n", + "578.0 | \n", + "-- | \n", + "78.0 | \n", + "656.0 | \n", + "332.0 | \n", + "988.0 | \n", + "672.0 | \n", + "
| 3 | \n", + "1953/54 | \n", + "All wheat | \n", + "672.0 | \n", + "1173.0 | \n", + "6 | \n", + "1851.0 | \n", + "556.0 | \n", + "-- | \n", + "87.0 | \n", + "643.0 | \n", + "214.0 | \n", + "857.0 | \n", + "994.0 | \n", + "
| 4 | \n", + "1954/55 | \n", + "All wheat | \n", + "994.0 | \n", + "984.0 | \n", + "3 | \n", + "1981.0 | \n", + "552.0 | \n", + "-- | \n", + "53.0 | \n", + "605.0 | \n", + "267.0 | \n", + "872.0 | \n", + "1109.0 | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| 287 | \n", + "2/ Hard Red Winter, Hard Red Spring, Soft Red ... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 288 | \n", + "3/ Includes flour and selected other products ... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 289 | \n", + "4/ Totals may not add due to rounding. | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 290 | \n", + "Source: USDA, Economic Research Service, based... | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
| 291 | \n", + "Updated: April 10, 2026 | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "<NA> | \n", + "
292 rows × 13 columns
\n", + "