<jupyter_start><jupyter_text><jupyter_code>!pip install wget==3.2
import wget

wget.download(url='https://archive.ics.uci.edu/ml/machine-learning-databases/00312/dow_jones_index.zip', out='./dados.zip')
import zipfile

with zipfile.ZipFile('./dados.zip', 'r') as fp:
  fp.extractall('./dados')
import os


os.rename('./dados/dow_jones_index.data', './dados_dow_jones_index.csv')
!pip install pandas==1.1.5
import pandas as pd


df = pd.read_csv('./dados_dow_jones_index.csv')
df.head(n=10)
df.columns.to_list()
linhas, colunas = df.shape
print(f'Numero de linhas: {linhas}')
print(f'Numero de colunas: {colunas}')
df_mcd = df[df['stock'] == 'MCD']
df_mcd = df_mcd[['date','open','high','low','close']]
df_mcd.head(n=10)


df_mcd.dtypes
for col in ['open','high','low','close']:
  df_mcd[col] = df_mcd[col].apply(lambda value: float(value.split(sep='$')[-1]))





df_mcd.head(n=10)

df_mcd.dtypes
!pip install seaborn==0.11.1
import seaborn as sns
plot = sns.lineplot(x="date", y="open", data=df_mcd)
_ = plot.set_xticklabels(labels=df_mcd['date'], rotation=90)
plot = sns.lineplot(x="date", y="close", data=df_mcd)
_ = plot.set_xticklabels(labels=df_mcd['date'], rotation=90)
plot = sns.lineplot(x="date", y="value", hue='variable', data=pd.melt(df_mcd, ['date']))
_ = plot.set_xticklabels(labels=df_mcd['date'], rotation=90)
plot.figure.savefig("./mcd.png")
df_ko = df[df['stock'] == 'KO']
df_ko = df_ko[['date','open','high','low','close']]
df_ko.head(n=10)
df.columns.to_list()
linhas, colunas = df.shape
print(f'Numeros de linhas: {linhas}')
print(f'Numeros de colunas: {colunas}')
df_ko = df_ko[['date','open','high','low','close']]
df_ko.head(n=10)

df_ko.dtypes
for col in ['open','high','low','close']:
  df_ko[col] = df_ko[col].apply(lambda value: float(value.split(sep='$')[-1]))
df_ko.head(n=10)

df_ko.dtypes
plot = sns.lineplot(x="date", y="open", data=df_ko)
_ = plot.set_xticklabels(labels=df_ko['date'], rotation=90)
plot = sns.lineplot(x="date", y="close", data=df_ko)
_ = plot.set_xticklabels(labels=df_ko['date'], rotation=90)
plot = sns.lineplot(x="date", y="value", hue='variable', data=pd.melt(df_ko, ['date']))
_ = plot.set_xticklabels(labels=df_mcd['date'], rotation=90)
plot.figure.savefig("./ko.png")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2206468763845813, 'fraction_numerical': 0.017722640673460344, 'mean_word_length': 7.1516245487364625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '47916', 'license': 'MIT', 'n_tokens_mistral': 998, 'n_tokens_neox': 964, 'n_words': 139, 'path': 'Untitled4.ipynb', 'repo_name': 'Nunesdejesus/Cursoemvideo-html5', 'size': '2257'}