Skip to main content

Data access and analysis of baby names statistics

Project description

babe

Note that the first time you import name, you need to have access to the Internet, and it will take a few seconds (depending on bandwidth) to download the required data.

But this data is automatically saved in a local file so things are faster the next time around.

To install:

pip install babe

Then in a python console or notebook...

from babe import names_by_us_states, names_all_us_states

names_all_us_state

This data frame provides popularity matrix for names of babies born in the US between 1910 and 2019.

names_all_us_states
popularity
name year
Aaban 2013 6
2014 6
Aadam 2019 6
Aadan 2008 12
2009 6
... ... ...
Zyriah 2013 7
2014 6
2016 5
Zyron 2015 5
Zyshonne 1998 5

594681 rows × 1 columns

names = set(names_all_us_states.reset_index()['name'].values)
print(f"{len(names)} unique names")
31862 unique names
years = set(names_all_us_states.reset_index()['year'])
print(f"Popularity stats cover years {min(years)} through {max(years)} (or subset thereof, depending on the name)")
Popularity stats cover years 1910 through 2019 (or subset thereof, depending on the name)
names_all_us_states.loc['Vanessa'].plot(figsize=(15, 4), style='-o', grid=True)

png

names_all_us_states.loc['Cora'].plot(figsize=(15, 4), style='-o', grid=True)

png

names_by_us_states

This dataframe provides the same as above, but by state. 51 US states are covered.

names_by_us_states
gender popularity
state name year
AK Mary 1910 F 14
Annie 1910 F 12
Anna 1910 F 10
Margaret 1910 F 8
Helen 1910 F 7
... ... ... ... ...
WY Theo 2019 M 5
Tristan 2019 M 5
Vincent 2019 M 5
Warren 2019 M 5
Waylon 2019 M 5

6122890 rows × 2 columns

states = set(names_by_us_states.reset_index()['state'])
print(f"{len(states)} states")
51 states
names_by_us_states.loc['CA']
gender popularity
name year
Mary 1910 F 295
Helen 1910 F 239
Dorothy 1910 F 220
Margaret 1910 F 163
Frances 1910 F 134
... ... ... ...
Zayvion 2019 M 5
Zeek 2019 M 5
Zhaire 2019 M 5
Zian 2019 M 5
Ziyad 2019 M 5

387781 rows × 2 columns

names_by_us_states.loc['CA'].loc['Cora']
gender popularity
year
1911 F 8
1912 F 9
1913 F 15
1914 F 15
1915 F 17
... ... ...
2015 F 269
2016 F 244
2017 F 284
2018 F 282
2019 F 256

109 rows × 2 columns

names_by_us_states.loc['CA'].loc['Cora'].plot(figsize=(15, 4), style='-o', grid=True)

png

names_by_us_states.loc['GA'].loc['Cora'].plot(figsize=(15, 4), style='-o', grid=True)

png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

babe-0.0.6.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

babe-0.0.6-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file babe-0.0.6.tar.gz.

File metadata

  • Download URL: babe-0.0.6.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for babe-0.0.6.tar.gz
Algorithm Hash digest
SHA256 f0ff2866cc62f10b269abe19f4194f00712683ef6e0d75c0491f0b38a8fec316
MD5 e0f974da066870dda746f44ef82e9d1d
BLAKE2b-256 597579aa91cf21b655db4d5b7e37e8de9c798a1ad1614f363e84edd05a3f76a1

See more details on using hashes here.

File details

Details for the file babe-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: babe-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for babe-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 14ff109cd95965cb6cc7fbf8ea04031a711a7e74d85070fd899a2a8e4b566a95
MD5 163e5670095b51d27167d721c33f7eef
BLAKE2b-256 10b101d9ca17a6066ea439af54e39311dc4952359c489b601929b673a8dd3eeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page