Skip to content

Commit

Permalink
Atualizar tutorial scipy e indice
Browse files Browse the repository at this point in the history
  • Loading branch information
melissawm committed Sep 1, 2024
1 parent c38264f commit 04a5959
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 196 deletions.
5 changes: 2 additions & 3 deletions tutorial/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ parts:
chapters:
- file: notebooks/01-Tutorial_NumPy.md
- file: notebooks/02-Tutorial_Matplotlib.md
- file: notebooks/03-Exemplo_Masked_Arrays.md
- file: notebooks/03-Tutorial_SciPy.md
- file: notebooks/04-Exemplo_SVD.md
- file: notebooks/05-Exemplo_Queimadas.md
- file: notebooks/06-Tutorial_SciPy.md
- file: notebooks/07-Exemplo_Regressao.md
- file: notebooks/0x-Exemplo_Masked_Arrays.md
31 changes: 20 additions & 11 deletions tutorial/notebooks/00-Tutorial_Python_Sul_2024.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.16.4
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

# O Ecossistema Científico no Python
Expand All @@ -29,20 +35,20 @@ import matplotlib as mpl
- Conceitos básicos e quando usar essas bibliotecas
- Onde buscar ajuda

```{code-cell}
```{code-cell} ipython3
from IPython.display import Image
Image(url="https://i.imgur.com/MBQqSmT.jpg", width=600)
```

### Computação Científica

```{code-cell}
```{code-cell} ipython3
Image("imagens/comp_cientifica.png", width=600)
```

Na prática...

```{code-cell}
```{code-cell} ipython3
Image("imagens/comp_cientifica_2.png", width=600)
```

Expand All @@ -52,7 +58,7 @@ Image("imagens/comp_cientifica_2.png", width=600)

### O que é o ecossistema científico do Python? Quem mora nele?

```{code-cell}
```{code-cell} ipython3
Image(url="https://media.springernature.com/full/springer-static/image/art%3A10.1038%2Fs41586-020-2649-2/MediaObjects/41586_2020_2649_Fig2_HTML.png", width=600)
```

Expand Down Expand Up @@ -98,12 +104,12 @@ Image(url="https://media.springernature.com/full/springer-static/image/art%3A10.

- [Parte 1. NumPy](01-Tutorial_NumPy.md)
- [Parte 2. Matplotlib](02-Tutorial_Matplotlib.md)
- Parte 3. Exemplos práticos
- [Arrays com máscara (masked arrays)](03-Exemplo_Masked_Arrays.md)
- [Parte 3. SciPy](03-Tutorial_SciPy.md)
- Parte 4. Exemplos práticos
- [Aproximação de imagens usando a SVD](04-Exemplo_SVD.md)
- [Queimadas](05-Exemplo_Queimadas.md)
- [Parte 4. SciPy](06-Tutorial_SciPy.md)
- [Regressão](07-Exemplo_Regressao.md)
- Exemplos extra
- [Arrays com máscara (masked arrays)](0x-Exemplo_Masked_Arrays.md)

---

Expand Down Expand Up @@ -132,3 +138,6 @@ Algumas referências interessantes e caminhos para mais informações além da d

`@melissawm`

```{code-cell} ipython3
```
29 changes: 29 additions & 0 deletions tutorial/notebooks/03-Tutorial_SciPy.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,35 @@ plt.ylabel('y(t)')
plt.show()
```

### Exemplo: Regressão usando 3 métodos

```{code-cell} ipython3
import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
# Criação de dados
x = np.arange(10)
y = x + 5*np.random.rand(10) - 6*np.random.rand(10)
# Regressão Linear
(a_linear, b_linear) = np.polyfit(x, y, 1)
# Ajuste quadrático
(a_quad, b_quad, c_quad) = np.polyfit(x, y, 2)
# Interpolação
f = interp1d(x, y)
# Gráfico
t = np.linspace(0, 9, 50)
plt.title('Exemplo: ajuste de curvas')
plt.plot(x, y, 'r*')
plt.plot(t, a_linear*t+b_linear,'g')
plt.plot(t, a_quad*t**2+b_quad*t+c_quad, 'm')
plt.plot(t, f(t), 'b')
plt.legend(['linear', 'quadrático', 'interpolação'])
plt.show();
```

### Exemplo: Teste de hipótese estatística

+++
Expand Down
Loading

0 comments on commit 04a5959

Please sign in to comment.