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.

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']
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
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']
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
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.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

babe-0.0.3-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: babe-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 77183a346a888f90595349ace1e1ee8d76b85c2609a52a6aaba2e88b22cc338b
MD5 ac664bb5cc1f261f4aaff2f066927457
BLAKE2b-256 13c1177a5ef60d8270411bdffd247abc85c800f8692b1cec8456cc8a069e13dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: babe-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3267671fc0d7133061e44970f4aa096453b1cac7067270a22ef33fe15aa47840
MD5 735dd91f4492f84ad738d285fbe253cc
BLAKE2b-256 7bae059f9cfc5a874a9046d287cb16cec922b1630767e33f3279731c3e7f0380

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