<jupyter_start><jupyter_text>1. Series<jupyter_code>notas = pd.Series([2,7,5,10,6])
notas<jupyter_output><empty_output><jupyter_text>1.1. Métodos (values e index)<jupyter_code>notas.index
notas.values<jupyter_output><empty_output><jupyter_text>1.2. Series com índices<jupyter_code>notas = pd.Series([2,7,5,10,6], index=["Wilfred", "Abbie", "Harry", "Julia", "Carrie"])
notas<jupyter_output><empty_output><jupyter_text>1.2.1. Rótulo<jupyter_code>notas["Wilfred"]<jupyter_output><empty_output><jupyter_text>1.3. Estatísticas (mean, std, describe)<jupyter_code>print("Média:", notas.mean())
print("Desvio padrão:", notas.std())
print("Estatísticas")
print(notas.describe())<jupyter_output><empty_output><jupyter_text>1.4. Funções matemáticas<jupyter_code>print(notas**2)<jupyter_output><empty_output><jupyter_text>1.4.1. NumPy: NumPy is the fundamental package for scientific computing with Python.<jupyter_code>print(np.log(notas))<jupyter_output><empty_output><jupyter_text>2. DataFrame<jupyter_code>df = pd.DataFrame(
     {'Aluno' : ["Wilfred", "Abbie", "Harry", "Julia", "Carrie"],
      'Faltas' : [3,4,2,1,4],
      'Prova' : [2,7,5,10,6],
      'Seminário': [8.5,7.5,9.0,7.5,8.0]
     })
df<jupyter_output><empty_output><jupyter_text>2.1. Tipos de dados<jupyter_code>df.dtypes<jupyter_output><empty_output><jupyter_text>2.2. Colunas<jupyter_code>df.columns
df["Seminário"]<jupyter_output><empty_output><jupyter_text>2.3. Estatística_OBS: dados numéricos ou categóricos_<jupyter_code>df.describe()<jupyter_output><empty_output><jupyter_text>2.4. Sort<jupyter_code>df.sort_values(by="Seminário")<jupyter_output><empty_output><jupyter_text>_Não altera o df original_<jupyter_code>df<jupyter_output><empty_output><jupyter_text>2.5. Selecionar valores<jupyter_code>df.loc[3]<jupyter_output><empty_output><jupyter_text>2.6. Boolean Indexing<jupyter_code>df[df["Seminário"] > 8.0]<jupyter_output><empty_output><jupyter_text>2.7. Operadores bitwise<jupyter_code>df[(df["Seminário"] > 8.0) & (df["Prova"] > 3)]<jupyter_output><empty_output><jupyter_text>3. Leitura de Dados<jupyter_code>df = pd.read_csv("data/master.csv")
df<jupyter_output><empty_output><jupyter_text>3.1. Head e Tail<jupyter_code>df.head(n=10)
df.tail()<jupyter_output><empty_output><jupyter_text>3.2. Unique<jupyter_code>df["country"].unique()<jupyter_output><empty_output><jupyter_text>3.3. Values Count<jupyter_code>df["sex"].value_counts()<jupyter_output><empty_output><jupyter_text>3.3.1 Normalize<jupyter_code>df["country"].value_counts(normalize=True)<jupyter_output><empty_output><jupyter_text>3.4. Group By<jupyter_code>df.groupby("country").mean()<jupyter_output><empty_output><jupyter_text>3.4.1 Dados de uma coluna<jupyter_code>df.groupby("country").mean()["suicides_no"].sort_values()<jupyter_output><empty_output><jupyter_text>3.5. Function<jupyter_code>def truncar(sexo):
    return sexo[:1]
df["sex"].apply(truncar)<jupyter_output><empty_output><jupyter_text>3.5.1. Lambda<jupyter_code>df["sex"].apply(lambda x: x[:1])<jupyter_output><empty_output><jupyter_text>3.6. Not a Number_Not a Number (NaN) é um valor especial definido no Numpy_  3.6.1. Remoção<jupyter_code>df
df.dropna()<jupyter_output><empty_output><jupyter_text>3.6.2. Preenchimento<jupyter_code>df.fillna(0.)<jupyter_output><empty_output><jupyter_text>3.6.3. True or False<jupyter_code>df.isna()<jupyter_output><empty_output><jupyter_text>4. Visualização de Dados  4.1. HistogramaFrequência do índice de desenvolvimento humano<jupyter_code>df["HDI for year"].plot.hist(bins=30, edgecolor='black')<jupyter_output><empty_output><jupyter_text>4.2. Barras<jupyter_code>df["country"].head(n=2000).value_counts().plot.bar()
df["country"].head(n=2000).value_counts().plot.barh()<jupyter_output><empty_output><jupyter_text>4.2. Dispersão<jupyter_code>df.plot.scatter(x='suicides/100k pop', y='HDI for year')<jupyter_output><empty_output><jupyter_text>5. Salvando<jupyter_code>df.to_csv("data/savando.csv")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1701913393756294, 'fraction_numerical': 0.031973816717019134, 'mean_word_length': 11.376947040498443, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 132, 'https://': 0, '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': '32', 'dir': 'jupyter-structured-clean-dedup', 'id': '207047', 'license': 'MIT', 'n_tokens_mistral': 1782, 'n_tokens_neox': 1744, 'n_words': 151, 'path': 'suicide.ipynb', 'repo_name': 'elileal/kungfu_Pandas', 'size': '3972'}