# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Imports

# +
# 4 libraries to this project
# -

import pandas as pd
import numpy as np
import sqlalchemy as sc
from matplotlib import pyplot as plt

# # Make a request

url_100 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25135/dados?formato=json'
url_500 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25136/dados?formato=json'
url_1000 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25137/dados?formato=json'
url_2000 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25138/dados?formato=json'
url_5000 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25139/dados?formato=json'
url_10000 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25140/dados?formato=json'
url_15000 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25141/dados?formato=json'
url_20000 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25142/dados?formato=json'
url_25000 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25143/dados?formato=json'
url_30000 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25144/dados?formato=json'
url_more_30000 = 'http://api.bcb.gov.br/dados/serie/bcdata.sgs.25145/dados?formato=json'

df_100 = pd.read_json(url_100)
df_100['ano'] = pd.DatetimeIndex(df_100['data']).year
df_100[['ano', 'valor']]

# +
df_100 = pd.read_json(url_100)
df_100['ano'] = pd.DatetimeIndex(df_100['data']).year
# df_100

plt.figure(figsize = (14,6))
plt.plot(df_100['ano'], df_100['valor'], 'd--', color='blue', alpha=0.9)
plt.legend()
plt.title('Outstanding by saving deposit bracket up to R$ 100')
# -

df_500 = pd.read_json(url_500)
df_500['ano'] = pd.DatetimeIndex(df_500['data']).year
df_500[['ano', 'valor']]

# +
df_500 = pd.read_json(url_500)
df_500['ano'] = pd.DatetimeIndex(df_500['data']).year
# df_500[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_500['ano'], df_500['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ 500')
# -

df_1000 = pd.read_json(url_1000)
df_1000['ano'] = pd.DatetimeIndex(df_1000['data']).year
df_1000[['ano', 'valor']]

# +
df_1000 = pd.read_json(url_1000)
df_1000['ano'] = pd.DatetimeIndex(df_1000['data']).year
# df_1000[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_1000['ano'], df_1000['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ 1000')
# -

df_2000 = pd.read_json(url_2000)
df_2000['ano'] = pd.DatetimeIndex(df_2000['data']).year
df_2000[['ano', 'valor']]

# +
df_2000 = pd.read_json(url_2000)
df_2000['ano'] = pd.DatetimeIndex(df_2000['data']).year
# df_2000[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_2000['ano'], df_2000['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ 2000')
# -

df_5000 = pd.read_json(url_5000)
df_5000['ano'] = pd.DatetimeIndex(df_5000['data']).year
df_5000[['ano', 'valor']]

# +
df_5000 = pd.read_json(url_5000)
df_5000['ano'] = pd.DatetimeIndex(df_5000['data']).year
# df_5000[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_5000['ano'], df_5000['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ 5000')
# -

df_10000 = pd.read_json(url_10000)
df_10000['ano'] = pd.DatetimeIndex(df_10000['data']).year
df_10000[['ano', 'valor']]

# +
df_10000 = pd.read_json(url_10000)
df_10000['ano'] = pd.DatetimeIndex(df_10000['data']).year
# df_10000[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_10000['ano'], df_10000['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ 10000')
# -

df_15000 = pd.read_json(url_15000)
df_15000['ano'] = pd.DatetimeIndex(df_15000['data']).year
df_15000[['ano', 'valor']]

# +
df_15000 = pd.read_json(url_15000)
df_15000['ano'] = pd.DatetimeIndex(df_15000['data']).year
# df_15000[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_15000['ano'], df_15000['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ 15000')
# -

df_20000 = pd.read_json(url_20000)
df_20000['ano'] = pd.DatetimeIndex(df_20000['data']).year
df_20000[['ano', 'valor']]

# +
df_20000 = pd.read_json(url_20000)
df_20000['ano'] = pd.DatetimeIndex(df_20000['data']).year
# df_20000[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_20000['ano'], df_20000['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ 20000')
# -

df_25000 = pd.read_json(url_25000)
df_25000['ano'] = pd.DatetimeIndex(df_25000['data']).year
df_25000[['ano', 'valor']]

# +
df_25000 = pd.read_json(url_25000)
df_25000['ano'] = pd.DatetimeIndex(df_25000['data']).year
# df_25000[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_25000['ano'], df_25000['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ 25000')
# -

df_30000 = pd.read_json(url_30000)
df_30000['ano'] = pd.DatetimeIndex(df_30000['data']).year
df_30000[['ano', 'valor']]

# +
df_30000 = pd.read_json(url_30000)
df_30000['ano'] = pd.DatetimeIndex(df_30000['data']).year
# df_30000[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_30000['ano'], df_30000['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ 30000')
# -

df_more_30000 = pd.read_json(url_more_30000)
df_more_30000['ano'] = pd.DatetimeIndex(df_more_30000['data']).year
df_more_30000[['ano', 'valor']]

# +
df_more_30000 = pd.read_json(url_more_30000)
df_more_30000['ano'] = pd.DatetimeIndex(df_more_30000['data']).year
# df_more_30000[['ano', 'valor']]

plt.figure(figsize = (14,6))
plt.plot(df_more_30000['ano'], df_more_30000['valor'], 'd--', color='blue', alpha=0.9)
plt.title('Outstanding by saving deposit bracket up to R$ more_30000')

StarcoderdataJupyterScriptsDedupFiltered