<jupyter_start><jupyter_text>Trabalho prático<jupyter_code># Bibliotecas
import numpy as np
import pandas as pd
# Código 01
z = np.zeros((4, ))
print('Z: ', z)
# Código 02
z = np.zeros((4, ))
z[1] = 1.
print('Z: ', z)
# Código 03
z = np.zeros((4, ))
z[1:] = 1.
print('Z: ', z)
# Código 04
z = np.zeros((4, ))
z[0:-1] = 1.
print('Z: ', z)
# Código 05
x = np.ones((2,2))+1
print('X:\n', x)
# Código 06
x = np.array([[1, 2], [3, 4]])
y = x[0, :]
y[1] = 10
print('X:\n', x)
# Código 07
x = np.array([[1, 3], [11, 10]])
print(np.mean(x[x > np.pi]))
# Código 08
data = {'animal' : ['cat', 'cat', 'snake', 'dog', 'dog', 'cat', 'snake'
                    , 'cat', 'dog', 'dog']
       , 'age' : [2.5, 3, .5, np.nan, 5, 2, 4.5, np.nan, 7, 3]
       , 'visits' : [1, 3, 2, 3, 2, 3, 11, 1, 2, 1]
       , 'priority' : ['yes', 'yes', 'no', 'yes', 'no', 'no', 'no', 'yes'
                    , 'no', 'no']}
labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
# Código 09
df = pd.DataFrame(data = data, index = labels)
# Código 10
y_true = np.array([1., 2., 1.])
y_pred = np.array([1.1, 1.98, 1.05])
np.sqrt(((y_true-y_pred)**2).mean())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2876830318690784, 'fraction_numerical': 0.06976744186046512, 'mean_word_length': 3.062937062937063, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, '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': '623843', 'license': 'MIT', 'n_tokens_mistral': 636, 'n_tokens_neox': 578, 'n_words': 145, 'path': 'bootcamp_igti/02_analise_dados/trabalho_pratico.ipynb', 'repo_name': 'joymaxnascimento/python', 'size': '1161'}