
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Python port of the R data package 'babynames'. This package provides US baby names data from the Social Security Administration (SSA). It contains all names used for at least 5 children of either sex in the United States. The package features the ability to switch between the data being imported as a Pandas DataFrame or a Polars DataFrame by setting an environment variable.
Python port of the R data package babynames
. This package provides US baby names data from the Social Security Administration (SSA). It contains all names used for at least 5 children of either sex in the United States. The package features the ability to switch between the data being imported as a Polars DataFrame (default) or a Pandas DataFrame by setting an environment variable.
[!NOTE]
Please note that the
pybabynames
package is a community-driven initiative and is not affiliated with Posit, Tidyverse, or the main babynames R package. Its evolution and maintenance stem solely from the collective efforts of community members.
Install this library using pip
into an environment that already has either Pandas or Polars installed.
pip install pybabynames
Missing Pandas or Polars? You can install these packages using:
pip install polars
pip install pandas
import pybabynames as bn
# Retrieve DataFrame of baby names
babynames = bn.babynames
# Retrieve DataFrame of applicant data for SSN
applicants = bn.applicants
# Retrieve DataFrame of Birth Data
births = bn.births
# Retrieve DataFrame of life expectancy
lifetables = bn.lifetables
[!IMPORTANT]
By default, we'll attempt to use the
polars
module. You can switch back to usingpandas
by specifying beforebabynames
import statement an environment flag like so:
# Specify desired DataFrame framework import os os.environ["DATAFRAME_FRAMEWORK"] = "pandas" # Load the package import pybabynames as bn
To contribute to this library, first checkout the code. Then create a new virtual environment:
cd pybabynames
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
python -m pip install -e '.[test]'
To run the tests:
python -m pytest
This Python package is a port of the R Data package babynames
by Hadley Wickham.
FAQs
Python port of the R data package 'babynames'. This package provides US baby names data from the Social Security Administration (SSA). It contains all names used for at least 5 children of either sex in the United States. The package features the ability to switch between the data being imported as a Pandas DataFrame or a Polars DataFrame by setting an environment variable.
We found that pybabynames demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.