Data Commons Pandas API

The Data Commons Pandas API is a superset of the Data Commons Python API: all functions from the Python API are also accessible from the Pandas API, and supplemental functions help with directly creating pandas objects using data from the Data Commons knowledge graph for common use cases.

Note: The Pandas API only supports V1 of the REST APIs.

Before proceeding, make sure you have followed the setup instructions below.

Install the Python Data Commons API

  1. If not done already, install python3 and pip3. See Setting up a Python development environment for procedures.
  2. Install the datacommons_pandas package:
$ pip install datacommons_pandas

You are ready to go! You can view our tutorials on how to use the API to perform certain tasks using Google Colab, or refer to pages in the navigation bar for detailed information about all the methods available.

Run Python interactively

The pages in this site demonstrate running the Pandas methods interactively from the Bash shell. To use this facility, be sure to import the datacommons_pandas package:

From your virtual environment, run:

python3
>>> import datacommons_pandas
>>>

Page last updated: November 21, 2024 • Send feedback about this page