Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atividade para casa 11 Renata #22

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,012 changes: 2,012 additions & 0 deletions exercicios/para-casa/atividadeparacasa.ipynb

Large diffs are not rendered by default.

Empty file.
8,793 changes: 8,793 additions & 0 deletions exercicios/para-casa/sao paulo.csv

Large diffs are not rendered by default.

715 changes: 715 additions & 0 deletions exercicios/para-sala/atividade.ipynb

Large diffs are not rendered by default.

8,793 changes: 8,793 additions & 0 deletions exercicios/para-sala/brasilia.csv

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions exercicios/para-sala/debate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Analisando a planilha, escolhemos a cidade de Brasilia ano de 2022
Temperatura máxima mensal / anual
Maior indice de radiação no dia / Menor indice de radiação do dia
Qual o mes houve mais precipitação
Qual época do mês que venta mais
Qual época do mês que venta menos
Ponto maior e menor de orvalho
3,057 changes: 3,057 additions & 0 deletions exercicios/para-sala/exercicio01.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6176,7 +6176,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
22 changes: 21 additions & 1 deletion material/material.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Selecionar um subconjunto de colunas e/ou linhas.
# Selecionar 3 colunas específicas
df_reduzido = df[['Coluna1', 'Coluna2', 'Coluna3']]

df_reduzido.head()

# Selecionar 1000 linhas aleatórias
df_reduzido = df_reduzido.sample(n=1000, random_state=42)
```
Expand Down Expand Up @@ -129,6 +131,9 @@ Identifica valores nulos no DataFrame, retornando um DataFrame booleano.
nulos = df.isnull()
print(nulos)

#numeros nulos
df.isnull().sum()

# Contagem de valores nulos em cada coluna
nulos_por_coluna = df.isnull().sum()
print(nulos_por_coluna)
Expand All @@ -143,8 +148,17 @@ df_sem_nulos = df.dropna()

# Remove colunas que contenham valores nulos
df_sem_nulos_colunas = df.dropna(axis=1)

# Remover coluna valores
df_sem_nulo = df.dropna(subset=['nome da coluna'])
```

# Remover

remover = df.dropna(axis=0, how='all')
remover


### 14. `fillna()`
Preenche valores nulos com um valor específico.

Expand All @@ -161,11 +175,12 @@ Substitui valores específicos no DataFrame.

```python
# Substitui todos os valores 0 por NaN
df_substituido = df.replace(0, np.nan)
df_substituido = df.replace(0, -1)

# Substitui um valor específico em uma coluna
df['Coluna1'] = df['Coluna1'].replace('ValorAntigo', 'ValorNovo')
```
df_substituido.head(9)

### 16. `drop_duplicates()`
Remove linhas duplicadas do DataFrame.
Expand All @@ -189,3 +204,8 @@ df['Coluna1_normalizada'] = (df['Coluna1'] - df['Coluna1'].min()) / (df['Coluna1
df['Coluna1_zscore'] = (df['Coluna1'] - df['Coluna1'].mean()) / df['Coluna1'].std()
```

# coluna_temperatura_maxima = pd.to_numeric(df('TEMPERATURA MÁXIMA NA HORA ANT. (AUT) (°C)'), errors='coerce')
# coluna_temperatura_maxima = pd.to_numeric(df['TEMPERATURA MÁXIMA NA HORA ANT. (AUT) (°C)'], errors='coerce')

# pip install matplotlib