Prediction of gender probabilities for English names.
Project description
Prediction of genders of english names based on US Social Security data. The gender probability of each name is computed based on the number of male and female babies that were given this name between 1880 and 2017.
The full data can be found at https://www.ssa.gov/oact/babynames/limits.html
Description
The main function returns the probability for a given english name to be a male name. There are optional arguments start_year (default 1880) and end_year (default 2018) to use a specific period of time for calculation. For instance, for gender prediction of babyboomers, the period can be set to 1946-1965. If the name is absent from the database, None
is returned.
Installation
Requires package sqlite3. The code was only tested with Python 3.7.
$ pip install NameGenderPredictor
Basic Usage
Function predict_gender
is case insensitive for names (see below).
>>> from NameGenderPredictor import predict_gender
>>> print(predict_gender('john'))
0.9957852975260119
>>> print(predict_gender('Avi'))
0.8783253379851723
>>> print(predict_gender('chris'))
0.8632186721917374
>>> print(predict_gender('chris'),start_year=2000,end_year=2010)
0.9833235466823254
>>> print(predict_gender('chris'),start_year=1950,end_year=1965)
0.8111958317448215
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for NameGenderPredictor-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6a34f697c93fa0588dd1b1e68dc0163da08dab06bf7d898b420e60252ed05a6 |
|
MD5 | 399ce83dbaab5324218ef7a35ebd9b3c |
|
BLAKE2b-256 | a94357aafaff00c5b84abde2879a61187d2f54b114d4f6a28c37377d0ecf1aae |
Hashes for NameGenderPredictor-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 229a21645134a8c6ac7c32df8d48c2d03d6241cee2736c2aec99819139160ec4 |
|
MD5 | db7e8065d1d905997eff74f1c3f6d41e |
|
BLAKE2b-256 | c2e601e10e0721fc6190252e4cd89743950c93f3551605ff309c8d247d65c363 |