Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Jupyter notebook Slide.ipynb

Views: 104
Kernel: Python 3
from notebook.services.config import ConfigManager from IPython.paths import locate_profile cm = ConfigManager(profile_dir=locate_profile(get_ipython().profile)) cm.update('livereveal', { 'theme': 'beige', 'transition': 'zoom', 'start_slideshow_at': 'selected', })
{'start_slideshow_at': 'selected', 'theme': 'beige', 'transition': 'zoom'}

Minha primeira sessão de Slides

por Ney Lemke

Teste

Fórmulas

Eu posso escrever fórmulas:

12\frac{1}{2}

Ou coisas mais avançadas:

∮B⃗⋅dS⃗=0\oint\vec{B}\cdot d\vec{S}=0

Listas

Eu posso incluir listas

  • entender o sistema

  • fazer simulações

  • será prático?

  1. Teste

  2. Resre2

Posso incluir links como esse para o Google

Eu posso inserir código diretamente e de forma interativa

1+1
2

Tabelas

First HeaderSecond Header
Content CellContent Cell
Content CellContent Cell

Código

def f(x): return x+1```

Quote

Minhas Lembranças

import numpy as np import skimage from skimage import img_as_float import skimage.filters as skif from skimage.color import rgb2gray import skimage.data as skid import skimage.exposure as skie from notebook.widgets import interact import matplotlib.pyplot as plt import seaborn %matplotlib inline plt.style.use('ggplot')
/Users/neylemke/anaconda/lib/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') /Users/neylemke/anaconda/lib/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') /Users/neylemke/anaconda/lib/python3.5/site-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`. "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
chelsea = skid.chelsea()
chelsea.shape, chelsea.dtype
((300, 451, 3), dtype('uint8'))
plt.imshow(chelsea) plt.axis('off')
(-0.5, 450.5, 299.5, -0.5)
Image in a Jupyter notebook
img = rgb2gray(chelsea)
p2, p98 = np.percentile(img, (2, 98))
img_rescale = skie.rescale_intensity(img, in_range=(p2, p98))
img_eq = skie.equalize_hist(img)
img_adapteq = img_as_float(skie.equalize_adapthist(img, clip_limit=0.03))
/Users/neylemke/anaconda/lib/python3.5/site-packages/skimage/util/dtype.py:110: UserWarning: Possible precision loss when converting from float64 to uint16 "%s to %s" % (dtypeobj_in, dtypeobj))
hist_types = dict([('Contrast stretching', img_rescale), ('Histogram equalization', img_eq), ('Adaptive equalization', img_adapteq)])

Interatividade

@interact(hist_type=list(hist_types.keys())) def display_result(hist_type): result = hist_types[hist_type] # We display the processed grayscale image on the left. plt.subplot(121) plt.imshow(result, cmap='gray') plt.axis('off') # We display the histogram on the right. plt.subplot(122) plt.hist(result.ravel(), bins=np.linspace(0., 1., 256), histtype='step', color='black') plt.show()
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-1-d66705dea998> in <module>() 1 2 ----> 3 @interact(hist_type=list(hist_types.keys())) 4 def display_result(hist_type): 5 result = hist_types[hist_type] NameError: name 'interact' is not defined