<jupyter_start><jupyter_text>Speranza di Vita alla Nascita- Serie storiche da World Bank- Libreria python -> https://github.com/OliverSherouse/wbdata- Api World Bank -> http://data.worldbank.org/developers/api-overview<jupyter_code>import os
import wbdata
import pandas as pd
dir_df = os.path.join(os.path.abspath(''),'stg')
# List of datasource -> 16 Healt
# wbdata.get_source()
# Lista di indicatori -> SP.DYN.LE00.IN      	Life expectancy at birth, total (years)
# wbdata.get_indicator(source=16)
#wbdata.search_countries("ital")
# Interessato solo all'Italia -> Resitutisce un Dictionary
dc = wbdata.get_data("SP.DYN.LE00.IN", country='ITA')
# Trasformo in DataFrame
df = pd.DataFrame(dc)
df.drop(['decimal','indicator','country'], axis=1, inplace=True)
df.rename(columns={'value': 'Speranza di vita alla nascita'}, inplace=True)
df.head(2)
df_filename = r'df_g3.pkl'
df_fullpath = os.path.join(dir_df, df_filename)
df.to_pickle(df_fullpath)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14358974358974358, 'fraction_numerical': 0.011282051282051283, 'mean_word_length': 6.0215827338129495, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '303868', 'license': 'Apache-2.0', 'n_tokens_mistral': 377, 'n_tokens_neox': 371, 'n_words': 75, 'path': 'G3_data_analysis.ipynb', 'repo_name': 'Cesaaar/od_la_grande_fuga', 'size': '975'}