Postagens

Mostrando postagens de outubro, 2017

IPython Notebook

Imagem
Retirado deste site . O  IPython notebook  é um ambiente web onde você pode fazer cálculos, executar códigos, plotar gráficos e criar apresentações com histórias e fotos. Os arquivos criados podem ser salvos em HTML e PDF ou compartilhados no  IPython Notebook Viewer . Bom, né? O vídeo abaixo dá uma visão geral da ferramenta:

Linear algebra (numpy.linalg)

Imagem
Texto e código retirado deste site . Matrix and vector products dot (a, b[, out]) Dot product of two arrays. linalg.multi_dot (arrays) Compute the dot product of two or more arrays in a single function call, while automatically selecting the fastest evaluation order. vdot (a, b) Return the dot product of two vectors. inner (a, b) Inner product of two arrays. outer (a, b[, out]) Compute the outer product of two vectors. matmul (a, b[, out]) Matrix product of two arrays. tensordot (a, b[, axes]) Compute tensor dot product along specified axes for arrays >= 1-D. einsum (subscripts, *operands[, out, dtype, ...])   Evaluates the Einstein summation convention on the operands. linalg.matrix_power (M, n) Raise a square matrix to the (integer) power  n . kron (a, b) Kronecker product of two arrays. Decompositions linalg.cholesky (a) Cholesky decomposition. linalg.qr (a[, mode]) Compute the qr factorization of a matrix. linalg.svd (a[, full_matrices, compute_uv]) S

Web Scraping imgur.com

Imagem
Texto e código retirado deste site . I’m trying to “scrape” images from Imgur using BeautifulSoup and requests but I’m only getting the first page of results. Why? The example URL we’re given is  http://imgur.com/r/funny The code uses  requests  to fetch the HTML and  BeautifulSoup  with  html5lib  to parse it. If you don’t have these install already you can use install them using  pip  e.g. pip install beautifulsoup4 requests html5lib --user One thing to note is that  imgur.com has an api . You use it, taking the blue pill—the article ends. You take the red pill—you stay in Wonderland, and I show you how deep a  JSON  response goes. Remember: all I’m offering is the truth. Nothing more. “Developer Tools” Usually the first step to take is to debug the page in question inside your browser using the  “Developer Tools”  (although currently it seems to called  “Web Developer”  in  Firefox ) mainly the  Inspector  tab and the  Network  tab. So normally when you sc