|
| 1 | +BigQuery DataFrames (BigFrames) |
| 2 | +=============================== |
| 3 | + |
| 4 | + |
| 5 | +|GA| |pypi| |versions| |
| 6 | + |
| 7 | +BigQuery DataFrames (also known as BigFrames) provides a Pythonic DataFrame |
| 8 | +and machine learning (ML) API powered by the BigQuery engine. It provides modules |
| 9 | +for many use cases, including: |
| 10 | + |
| 11 | +* `bigframes.pandas <https://dataframes.bigquery.dev/reference/api/bigframes.pandas.html>`_ |
| 12 | + is a pandas API for analytics. Many workloads can be |
| 13 | + migrated from pandas to bigframes by just changing a few imports. |
| 14 | +* `bigframes.ml <https://dataframes.bigquery.dev/reference/index.html#ml-apis>`_ |
| 15 | + is a scikit-learn-like API for ML. |
| 16 | +* `bigframes.bigquery.ai <https://dataframes.bigquery.dev/reference/api/bigframes.bigquery.ai.html>`_ |
| 17 | + are a collection of powerful AI methods, powered by Gemini. |
| 18 | + |
| 19 | +BigQuery DataFrames is an `open-source package <https://github.com/googleapis/google-cloud-python>`_. |
| 20 | + |
| 21 | +.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg |
| 22 | + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability |
| 23 | +.. |pypi| image:: https://img.shields.io/pypi/v/bigframes.svg |
| 24 | + :target: https://pypi.org/project/bigframes/ |
| 25 | +.. |versions| image:: https://img.shields.io/pypi/pyversions/bigframes.svg |
| 26 | + :target: https://pypi.org/project/bigframes/ |
| 27 | + |
| 28 | +Getting started with BigQuery DataFrames |
| 29 | +---------------------------------------- |
| 30 | + |
| 31 | +The easiest way to get started is to try the |
| 32 | +`BigFrames quickstart <https://cloud.google.com/bigquery/docs/dataframes-quickstart>`_ |
| 33 | +in a `notebook in BigQuery Studio <https://cloud.google.com/bigquery/docs/notebooks-introduction>`_. |
| 34 | + |
| 35 | +To use BigFrames in your local development environment, |
| 36 | + |
| 37 | +1. Run ``pip install --upgrade bigframes`` to install the latest version. |
| 38 | + |
| 39 | +2. Setup `Application default credentials <https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment>`_ |
| 40 | + for your local development environment enviroment. |
| 41 | + |
| 42 | +3. Create a `GCP project with the BigQuery API enabled <https://cloud.google.com/bigquery/docs/sandbox>`_. |
| 43 | + |
| 44 | +4. Use the ``bigframes`` package to query data. |
| 45 | + |
| 46 | +.. code-block:: python |
| 47 | +
|
| 48 | + import bigframes.pandas as bpd |
| 49 | +
|
| 50 | + bpd.options.bigquery.project = your_gcp_project_id # Optional in BQ Studio. |
| 51 | + bpd.options.bigquery.ordering_mode = "partial" # Recommended for performance. |
| 52 | + df = bpd.read_gbq("bigquery-public-data.usa_names.usa_1910_2013") |
| 53 | + print( |
| 54 | + df.groupby("name") |
| 55 | + .agg({"number": "sum"}) |
| 56 | + .sort_values("number", ascending=False) |
| 57 | + .head(10) |
| 58 | + .to_pandas() |
| 59 | + ) |
| 60 | +
|
| 61 | +Documentation |
| 62 | +------------- |
| 63 | + |
| 64 | +To learn more about BigQuery DataFrames, visit these pages |
| 65 | + |
| 66 | +* `Introduction to BigQuery DataFrames (BigFrames) <https://cloud.google.com/bigquery/docs/bigquery-dataframes-introduction>`_ |
| 67 | +* `Sample notebooks <https://github.com/googleapis/google-cloud-python/tree/main/notebooks>`_ |
| 68 | +* `API reference <https://dataframes.bigquery.dev/>`_ |
| 69 | +* `Source code (GitHub) <https://github.com/googleapis/google-cloud-python>`_ |
| 70 | + |
| 71 | +License |
| 72 | +------- |
| 73 | + |
| 74 | +BigQuery DataFrames is distributed with the `Apache-2.0 license |
| 75 | +<https://github.com/googleapis/google-cloud-python/blob/main/LICENSE>`_. |
| 76 | + |
| 77 | +It also contains code derived from the following third-party packages: |
| 78 | + |
| 79 | +* `Ibis <https://ibis-project.org/>`_ |
| 80 | +* `pandas <https://pandas.pydata.org/>`_ |
| 81 | +* `Python <https://www.python.org/>`_ |
| 82 | +* `scikit-learn <https://scikit-learn.org/>`_ |
| 83 | +* `XGBoost <https://xgboost.readthedocs.io/en/stable/>`_ |
| 84 | +* `SQLGlot <https://sqlglot.com/sqlglot.html>`_ |
| 85 | + |
| 86 | +For details, see the `third_party |
| 87 | +<https://github.com/googleapis/google-cloud-python/tree/main/third_party/bigframes_vendored>`_ |
| 88 | +directory. |
| 89 | + |
| 90 | + |
| 91 | +Contact Us |
| 92 | +---------- |
| 93 | + |
| 94 | +For further help and provide feedback, you can email us at `bigframes-feedback@google.com <https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=bigframes-feedback@google.com>`_. |
0 commit comments