This package provides data on various factors that surround and potentially influence longevity by country. Data includes the average lifespan, healthcare expenditure, by country, education spend, and more.
Project description
longevity_factors_by_country
This package provides data on various factors that surround and potentially influence longevity by country. Data includes the average lifespan, healthcare expenditure, by country, education spend, and more.
Installation
$ pip install longevity_factors_by_country
Purpose:
The purpose of this package is understand macro trends that can impact life expectancy at a national level over the span of several years. I've included data about health spend as a percentage of GDP, education spend as a percentage of GDP, happiness levels, inequality presented with the Gini coefficient.
I chose the data project option for my project.
Installation
Here is the package: https://pypi.org/project/longevity_factors_by_country/ Install the package: pip install longevity_factors_by_country
Install tests
pip install -i https://test.pypi.org/simple/ longevity_factors_by_country
Important Information
Data for Project
Data is uploaded in the "DataForPackage" Folder I used Amazon RDS to store my data using postgresql. You can access the database by the following credentials: Login: qmssanj - username qmssproject2023 - password
Command to access the database: psql --host=database-qmss-anj.c8fpusvnobjg.us-east-2.rds.amazonaws.com --port=5432 --username=qmssanj password --dbname=postgres`
Code
In the DataDisplay.ipynb in the Final Project folder, I display the data that I've collected, cleaned, and aggregated. I also display two functions that I made to show highest and lowest values. clean_data.py has most of the substance of my project, that's where I do all of the data wrangling. Usage longevity_factors_by_country.py contains all methods that are meant to be used publicly
getLongevityDataForYear is the primary method for data display, start here when you import the package. This method takes a year in string format and returns all countries and their relevant columns for that year.
Once you have a data frame from this function, you can use other methods.
getCountriesWithTopLifeSpan takes the data frame and an integer, n, it then returns the n countries with the longest life spans for the data frame
getCountriesWithLowestLifeSpan takes the data frame and an integer, n, it then returns the n countries with the lowest life spans for the data frame
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
longevity_factors_by_country
was created by Anjana Rao. It is licensed under the terms of the MIT license.
Credits
longevity_factors_by_country
was created with cookiecutter
and the py-pkgs-cookiecutter
template.
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
Built Distribution
Hashes for longevity_factors_by_country-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23f058e8689b6550ad68a06eb076e96f42bbac8540ecd97fb8b750616b815eb0 |
|
MD5 | 1afd3101226ad2feda2c255044ca8338 |
|
BLAKE2b-256 | ea6df05d908a1da761f2a0aa064bf47c0a60345378caa0a212f3a8140a440984 |
Hashes for longevity_factors_by_country-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8fc608100dbf5b001e1f1718e7efb14ce908e08bd4bda763d6517fd64e1c0e3 |
|
MD5 | ff30f6a63c488eccec84541a942cefab |
|
BLAKE2b-256 | 40992ab87b3525f9b5146537a21dfd2c1e4e03d2251432c938fb3f824df53578 |