class: center, middle, inverse, title-slide # Nociones básicas ## R y Python
⚔ ### Duvan Nieves ### 20 mayo, 2020 --- class: inverse,center, middle # ¿Por qué es importante aprender a programar? <img src="lenguaje-programacion.jpg" width="2560" /> Image credit: <a href="https://cdn.computerhoy.com/sites/navi.axelspringer.es/public/media/image/2019/06/lenguaje-programacion.jpg" target="_blank">Cdn</a> --- # Lenguajes de programación -- * Bajo Nivel `\(^1\)` * Lenguaje de máquina : Dificil de comprender por seres humanos [Binario]. <img src="1303635.png" width="300" height="100" style="display: block; margin: auto;" /> -- * Alto nivel `\(^2\)` * Pueden ser escritos y comprendidos por seres humanos. * Se ejecutan en diversos SO y equipos <img src="karrier.jpg" width="300" height="100" style="display: block; margin: auto;" /> -- .footnote[ [1](https://conociendoalgoritmo.weebly.com/uploads/4/0/2/6/40267963/1303635.png?390) [2](https://www.multisoft.hu/wp-content/uploads/karrier.jpg) ] --- # Ranking <img src="ieee.png" width="600" height="450" style="display: block; margin: auto;" /> <center>Fuente : <a href="https://spectrum.ieee.org/" target="_blank">https://spectrum.ieee.org/</a> </center> --- background-image: url("bin.gif") background-size: cover background-position: 50% 50% class: center, middle, inverse # Lenguajes de alto nivel --- class: inverse,center, middle # ¿Por qué que aprendemos a programar? <img src="hombre.jpg" width="200" height="300" /> Image credit: <a href="https://cde.2.trome.pe/ima/0/1/2/1/0/1210803.jpg" target="_blank">Cde</a> --- background-image: url("Problemas.png") background-size: cover background-position: 25% 25% class: inverse --- class: inverse,center, middle # ¿Cómo funciona un algoritmo? --- class: center, middle # Programación y ciencia de datos -- <img src="data-science.svg" width="600" height="250" style="display: block; margin: auto;" /> -- <img src="data-sci.png" width="450" height="250" style="display: block; margin: auto;" /> --- <br><br><br> <img src="R-Python.png" width="2847" /> <br><br><br><br> <center> Image credit: <a href="https://cio.edu.umh.es/wp-content/uploads/sites/1274/2019/04/R-Python.png" target="_blank">Cio</a> </center> --- class: inverse,center, middle # Instalando R y Python # Windows --- # Instalacion de [R](https://cran.r-project.org/bin/windows/base/) ![](R.gif) --- # Instalacion de [Python](https://www.python.org/downloads/release/python-382/) ![](python.gif) --- # Instalacion de [Anaconda](https://www.anaconda.com/products/individual) ![](anaconda.gif) --- class: inverse,center, middle # Instalando R # Ubuntu --- # Instalacion de R * Podemos buscar r-base en synaptic ó * Ejecutar en la consola o terminal : -- ```r sudo apt install r-base ``` -- ![](r-base.png) --- class: inverse,center, middle # Entornos de desarrollo --- # Entorno para R (I) * [Rstudio](https://rstudio.com/products/rstudio/download/) <br> ![](Rstudio.gif) --- # Entorno para R (II) * [Rcommander](https://www.rcommander.com/) Abrir R e instalar de la siguiente forma -- ```r install.packages("Rcmdr") ``` -- <img src="Rcmdr.png" width="450" height="350" style="display: block; margin: auto;" /> --- # Entorno Python (I) * [Jupyter](https://jupyter.org/) Abrir Terminal: -- Actualizar instalador de modulos de python ```r pip3 install --upgrade pip ``` -- .pull-left[ Jupyter Notebook ```r pip3 install jupyter ``` ![](notebook.png) ] .pull-right[ Jupyter Lab ```r pip3 install jupyterlab ``` ![](lab.png) ] --- # Entorno Python (II) * [Spyder](https://www.spyder-ide.org/) Abrir Terminal: -- ```r pip3 install spyder ``` -- <img src="Spyder.png" width="550" height="350" style="display: block; margin: auto;" /> --- # Entorno Python (III) * [PyCharm](https://www.jetbrains.com/es-es/pycharm/) -- ![](pycharm.jpg) --- # Opciones Online -- .pull-left[ * [Rcloud](https://rstudio.cloud/) * [Google Colab](https://colab.research.google.com/notebooks/intro.ipynb) <!--https://jupyter.org/try--> * [Azure Notebook](https://notebooks.azure.com/) * [Kaggle Notebook](https://www.kaggle.com/kernels) * [IBM DataPlatform Notebooks](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/notebooks-parent.html) * [CoCalc](https://cocalc.com/) * [Datalore](https://datalore.io/) ] .pull-right[ ![](online_gif.gif) ] --- # Opciones Móviles .pull-left[ .center[ [QPython 3L](https://play.google.com/store/apps/details?id=org.qpython.qpy3&hl=es_CO) ![](Qpython.webp) ] ] .pull-right[ .center[ [Pydroid 3](https://play.google.com/store/apps/details?id=ru.iiec.pydroid3&hl=es_CO) ![](pydroid.webp) ] ] --- class: inverse,center, middle # ¿Que podemos hacer programando? --- #Mapas (I) <img src="am_files/figure-html/unnamed-chunk-18-1.png" style="display: block; margin: auto;" /> --- #Mapas (II) <img src="am_files/figure-html/unnamed-chunk-19-1.png" style="display: block; margin: auto;" /> --- #Mapas (III) ```r library(colmaps) colmap(municipios[municipios@data$depto =='Santander',]) + ggtitle("Santander - Fronteras Municipales") ``` <img src="am_files/figure-html/unnamed-chunk-20-1.png" style="display: block; margin: auto;" /> --- # Mapas animados <img src="final.gif" width="35%" height="35%" style="display: block; margin: auto;" /> --- # Mapas interactivos ```r library(leaflet) leaflet() %>% addTiles() %>% setView(-75.576576, 6.261493, zoom = 13.5) ```
--- # Gráficos interactivos (I) ```r library(plotly) plot_ly(z = ~volcano) %>% add_surface() ```
--- # Gráficos interactivos (II) ```r ggplotly(GGally::ggpairs(iris %>% select(-Species))) ```
--- # Gráficos animados ![](am_files/figure-html/unnamed-chunk-25-1.gif)<!-- --> --- # Tablas interactivas
--- #Gráficos 3D animados ![](gif_Fig_1.gif) --- #Mapas globales ![](sst.png) --- class: inverse,center, middle # Conceptos básicos --- # Tipos de datos en R y Python (I) -- .pull-left[ <center>Python</center> <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>S</span><span style='color:orange'>t</span><span style='color:orange'>r</span><span style='color:orange'>i</span><span style='color:orange'>n</span><span style='color:orange'>g</span><br><span style='color:orange'>x</span><span style='color:orange'> </span><span style='color:orange'>=</span><span style='color:orange'> </span><span style='color:orange'>"</span><span style='color:orange'>H</span><span style='color:orange'>o</span><span style='color:orange'>l</span><span style='color:orange'>a</span><span style='color:orange'> </span><span style='color:orange'>A</span><span style='color:orange'>m</span><span style='color:orange'>e</span><span style='color:orange'>t</span><span style='color:orange'>"</span><br><span style='color:orange'>t</span><span style='color:orange'>y</span><span style='color:orange'>p</span><span style='color:orange'>e</span><span style='color:orange'>(</span><span style='color:orange'>x</span><span style='color:orange'>)</span></code> ``` <class 'str'> ``` <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>C</span><span style='color:orange'>o</span><span style='color:orange'>m</span><span style='color:orange'>p</span><span style='color:orange'>l</span><span style='color:orange'>e</span><span style='color:orange'>j</span><span style='color:orange'>o</span><span style='color:orange'>s</span><br><span style='color:orange'>x</span><span style='color:orange'> </span><span style='color:orange'>=</span><span style='color:orange'> </span><span style='color:orange'>3</span><span style='color:orange'>.</span><span style='color:orange'>1</span><span style='color:orange'>4</span><span style='color:orange'>j</span><br><span style='color:orange'>t</span><span style='color:orange'>y</span><span style='color:orange'>p</span><span style='color:orange'>e</span><span style='color:orange'>(</span><span style='color:orange'>x</span><span style='color:orange'>)</span></code> ``` <class 'complex'> ``` ] <center>R</center> .pull-right[ <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>C</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>á</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>s</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'><</span><span style='color:CornflowerBlue'>-</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>"</span><span style='color:CornflowerBlue'>H</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>l</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>A</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>"</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>y</span><span style='color:CornflowerBlue'>p</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>f</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>)</span></code> ``` ## [1] "character" ``` <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>C</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>p</span><span style='color:CornflowerBlue'>l</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>j</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>s</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'><</span><span style='color:CornflowerBlue'>-</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>3</span><span style='color:CornflowerBlue'>.</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>4</span><span style='color:CornflowerBlue'>i</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>y</span><span style='color:CornflowerBlue'>p</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>f</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>)</span></code> ``` ## [1] "complex" ``` ] --- # Tipos de datos en R y Python (II) -- .pull-left[ <center>Python</center> <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>N</span><span style='color:orange'>u</span><span style='color:orange'>m</span><span style='color:orange'>é</span><span style='color:orange'>r</span><span style='color:orange'>i</span><span style='color:orange'>c</span><span style='color:orange'>o</span><span style='color:orange'>s</span><br><span style='color:orange'>x</span><span style='color:orange'> </span><span style='color:orange'>=</span><span style='color:orange'> </span><span style='color:orange'>1</span><span style='color:orange'>2</span><br><span style='color:orange'>y</span><span style='color:orange'> </span><span style='color:orange'>=</span><span style='color:orange'> </span><span style='color:orange'>1</span><span style='color:orange'>2</span><span style='color:orange'>.</span><span style='color:orange'>0</span><span style='color:orange'> </span><br><span style='color:orange'>t</span><span style='color:orange'>y</span><span style='color:orange'>p</span><span style='color:orange'>e</span><span style='color:orange'>(</span><span style='color:orange'>x</span><span style='color:orange'>)</span></code> ``` <class 'int'> ``` <code class ='r hljs remark-code'><span style='color:orange'>t</span><span style='color:orange'>y</span><span style='color:orange'>p</span><span style='color:orange'>e</span><span style='color:orange'>(</span><span style='color:orange'>y</span><span style='color:orange'>)</span></code> ``` <class 'float'> ``` ] .pull-right[ <center>R</center> <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>N</span><span style='color:CornflowerBlue'>u</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>é</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>s</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'><</span><span style='color:CornflowerBlue'>-</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>2</span><span style='color:CornflowerBlue'>L</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>y</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'><</span><span style='color:CornflowerBlue'>-</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>2</span><span style='color:CornflowerBlue'>.</span><span style='color:CornflowerBlue'>0</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>y</span><span style='color:CornflowerBlue'>p</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>f</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>)</span></code> ``` ## [1] "integer" ``` <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>y</span><span style='color:CornflowerBlue'>p</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>f</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>y</span><span style='color:CornflowerBlue'>)</span></code> ``` ## [1] "double" ``` ] --- # Tipos de datos en R y Python (III) -- .pull-left[ <center>Python</center> <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>B</span><span style='color:orange'>o</span><span style='color:orange'>l</span><span style='color:orange'>e</span><span style='color:orange'>a</span><span style='color:orange'>n</span><span style='color:orange'>o</span><br><span style='color:orange'>x</span><span style='color:orange'> </span><span style='color:orange'>=</span><span style='color:orange'> </span><span style='color:orange'>T</span><span style='color:orange'>r</span><span style='color:orange'>u</span><span style='color:orange'>e</span><br><span style='color:orange'>t</span><span style='color:orange'>y</span><span style='color:orange'>p</span><span style='color:orange'>e</span><span style='color:orange'>(</span><span style='color:orange'>x</span><span style='color:orange'>)</span></code> ``` <class 'bool'> ``` ] .pull-right[ <center>R</center> <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>L</span><span style='color:CornflowerBlue'>ó</span><span style='color:CornflowerBlue'>g</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>s</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'><</span><span style='color:CornflowerBlue'>-</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>T</span><span style='color:CornflowerBlue'>R</span><span style='color:CornflowerBlue'>U</span><span style='color:CornflowerBlue'>E</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>y</span><span style='color:CornflowerBlue'>p</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>f</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>)</span></code> ``` ## [1] "logical" ``` ] --- # Objetos en R y Python (I) -- .pull-left[ <center>Python</center> <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>L</span><span style='color:orange'>i</span><span style='color:orange'>s</span><span style='color:orange'>t</span><span style='color:orange'>a</span><span style='color:orange'> </span><span style='color:orange'>c</span><span style='color:orange'>o</span><span style='color:orange'>m</span><span style='color:orange'>o</span><span style='color:orange'> </span><span style='color:orange'>v</span><span style='color:orange'>e</span><span style='color:orange'>c</span><span style='color:orange'>t</span><span style='color:orange'>o</span><span style='color:orange'>r</span><br><span style='color:orange'>x</span><span style='color:orange'> </span><span style='color:orange'>=</span><span style='color:orange'> </span><span style='color:orange'>l</span><span style='color:orange'>i</span><span style='color:orange'>s</span><span style='color:orange'>t</span><span style='color:orange'>(</span><span style='color:orange'>r</span><span style='color:orange'>a</span><span style='color:orange'>n</span><span style='color:orange'>g</span><span style='color:orange'>e</span><span style='color:orange'>(</span><span style='color:orange'>1</span><span style='color:orange'>,</span><span style='color:orange'> </span><span style='color:orange'>8</span><span style='color:orange'>)</span><span style='color:orange'>)</span><br><span style='color:orange'>x</span></code> ``` [1, 2, 3, 4, 5, 6, 7] ``` <code class ='r hljs remark-code'><span style='color:orange'>l</span><span style='color:orange'>e</span><span style='color:orange'>n</span><span style='color:orange'>(</span><span style='color:orange'>x</span><span style='color:orange'>)</span></code> ``` 7 ``` <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>P</span><span style='color:orange'>o</span><span style='color:orange'>s</span><span style='color:orange'>i</span><span style='color:orange'>c</span><span style='color:orange'>i</span><span style='color:orange'>o</span><span style='color:orange'>n</span><span style='color:orange'>e</span><span style='color:orange'>s</span><br><span style='color:orange'>x</span><span style='color:orange'>[</span><span style='color:orange'>0</span><span style='color:orange'>]</span></code> ``` 1 ``` ] .pull-right[ <center>R</center> <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>V</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>r</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'><</span><span style='color:CornflowerBlue'>-</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>:</span><span style='color:CornflowerBlue'>8</span><span style='color:CornflowerBlue'>)</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span></code> ``` ## [1] 1 2 3 4 5 6 7 8 ``` <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>l</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>n</span><span style='color:CornflowerBlue'>g</span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>h</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>)</span></code> ``` ## [1] 8 ``` <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>P</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>s</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>n</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>s</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>[</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>]</span></code> ``` ## [1] 1 ``` ] --- # Objetos en R y Python (II) -- .pull-left[ <center>Python</center> <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>M</span><span style='color:orange'>a</span><span style='color:orange'>t</span><span style='color:orange'>r</span><span style='color:orange'>i</span><span style='color:orange'>c</span><span style='color:orange'>e</span><span style='color:orange'>s</span><br><span style='color:orange'>i</span><span style='color:orange'>m</span><span style='color:orange'>p</span><span style='color:orange'>o</span><span style='color:orange'>r</span><span style='color:orange'>t</span><span style='color:orange'> </span><span style='color:orange'>n</span><span style='color:orange'>u</span><span style='color:orange'>m</span><span style='color:orange'>p</span><span style='color:orange'>y</span><span style='color:orange'> </span><span style='color:orange'>a</span><span style='color:orange'>s</span><span style='color:orange'> </span><span style='color:orange'>n</span><span style='color:orange'>p</span><br><span style='color:orange'>x</span><span style='color:orange'>=</span><span style='color:orange'>n</span><span style='color:orange'>p</span><span style='color:orange'>.</span><span style='color:orange'>m</span><span style='color:orange'>a</span><span style='color:orange'>t</span><span style='color:orange'>r</span><span style='color:orange'>i</span><span style='color:orange'>x</span><span style='color:orange'>(</span><span style='color:orange'>[</span><span style='color:orange'>[</span><span style='color:orange'>1</span><span style='color:orange'>,</span><span style='color:orange'>2</span><span style='color:orange'>,</span><span style='color:orange'>3</span><span style='color:orange'>]</span><span style='color:orange'>,</span><span style='color:orange'>[</span><span style='color:orange'>4</span><span style='color:orange'>,</span><span style='color:orange'>5</span><span style='color:orange'>,</span><span style='color:orange'>6</span><span style='color:orange'>]</span><span style='color:orange'>]</span><span style='color:orange'>)</span><br><span style='color:orange'>x</span></code> ``` matrix([[1, 2, 3], [4, 5, 6]]) ``` <code class ='r hljs remark-code'><span style='color:orange'>x</span><span style='color:orange'>.</span><span style='color:orange'>s</span><span style='color:orange'>h</span><span style='color:orange'>a</span><span style='color:orange'>p</span><span style='color:orange'>e</span></code> ``` (2, 3) ``` <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>P</span><span style='color:orange'>r</span><span style='color:orange'>i</span><span style='color:orange'>m</span><span style='color:orange'>e</span><span style='color:orange'>r</span><span style='color:orange'>a</span><span style='color:orange'> </span><span style='color:orange'>F</span><span style='color:orange'>i</span><span style='color:orange'>l</span><span style='color:orange'>a</span><br><span style='color:orange'>x</span><span style='color:orange'>[</span><span style='color:orange'>0</span><span style='color:orange'>]</span></code> ``` matrix([[1, 2, 3]]) ``` ] .pull-right[ <center>R</center> <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>M</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>s</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'><</span><span style='color:CornflowerBlue'>-</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>:</span><span style='color:CornflowerBlue'>6</span><span style='color:CornflowerBlue'>,</span><span style='color:CornflowerBlue'>n</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>w</span><span style='color:CornflowerBlue'>=</span><span style='color:CornflowerBlue'>2</span><span style='color:CornflowerBlue'>,</span><span style='color:CornflowerBlue'>b</span><span style='color:CornflowerBlue'>y</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>w</span><span style='color:CornflowerBlue'>=</span><span style='color:CornflowerBlue'>T</span><span style='color:CornflowerBlue'>)</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span></code> ``` ## [,1] [,2] [,3] ## [1,] 1 2 3 ## [2,] 4 5 6 ``` <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>d</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>)</span></code> ``` ## [1] 2 3 ``` <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>P</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>F</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>l</span><span style='color:CornflowerBlue'>a</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>[</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>,</span><span style='color:CornflowerBlue'>]</span></code> ``` ## [1] 1 2 3 ``` ] --- # Objetos en R y Python (II) .pull-left[ <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>P</span><span style='color:orange'>r</span><span style='color:orange'>i</span><span style='color:orange'>m</span><span style='color:orange'>e</span><span style='color:orange'>r</span><span style='color:orange'>a</span><span style='color:orange'> </span><span style='color:orange'>C</span><span style='color:orange'>o</span><span style='color:orange'>l</span><span style='color:orange'>u</span><span style='color:orange'>m</span><span style='color:orange'>n</span><span style='color:orange'>a</span><br><span style='color:orange'>x</span><span style='color:orange'>[</span><span style='color:orange'>:</span><span style='color:orange'>,</span><span style='color:orange'>0</span><span style='color:orange'>]</span></code> ``` matrix([[1], [4]]) ``` <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>S</span><span style='color:orange'>e</span><span style='color:orange'>g</span><span style='color:orange'>u</span><span style='color:orange'>n</span><span style='color:orange'>d</span><span style='color:orange'>a</span><span style='color:orange'> </span><span style='color:orange'>F</span><span style='color:orange'>i</span><span style='color:orange'>l</span><span style='color:orange'>a</span><span style='color:orange'>,</span><span style='color:orange'> </span><span style='color:orange'>t</span><span style='color:orange'>e</span><span style='color:orange'>r</span><span style='color:orange'>c</span><span style='color:orange'>e</span><span style='color:orange'>r</span><span style='color:orange'>a</span><span style='color:orange'> </span><span style='color:orange'>c</span><span style='color:orange'>o</span><span style='color:orange'>l</span><span style='color:orange'>u</span><span style='color:orange'>m</span><span style='color:orange'>n</span><span style='color:orange'>a</span><br><span style='color:orange'>x</span><span style='color:orange'>[</span><span style='color:orange'>1</span><span style='color:orange'>,</span><span style='color:orange'>2</span><span style='color:orange'>]</span></code> ``` 6 ``` ] .pull-right[ <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>P</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'> </span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>C</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>l</span><span style='color:CornflowerBlue'>u</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>n</span><span style='color:CornflowerBlue'>a</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>[</span><span style='color:CornflowerBlue'>,</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>]</span></code> ``` ## [1] 1 4 ``` <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>S</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>g</span><span style='color:CornflowerBlue'>u</span><span style='color:CornflowerBlue'>n</span><span style='color:CornflowerBlue'>d</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>F</span><span style='color:CornflowerBlue'>i</span><span style='color:CornflowerBlue'>l</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>,</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>l</span><span style='color:CornflowerBlue'>u</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>n</span><span style='color:CornflowerBlue'>a</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>x</span><span style='color:CornflowerBlue'>[</span><span style='color:CornflowerBlue'>2</span><span style='color:CornflowerBlue'>,</span><span style='color:CornflowerBlue'>3</span><span style='color:CornflowerBlue'>]</span></code> ``` ## [1] 6 ``` ] --- # Objetos en R y Python (III) -- .pull-left[ <center>Python</center> <code class ='r hljs remark-code'><span style='color:orange'>#</span><span style='color:orange'>D</span><span style='color:orange'>a</span><span style='color:orange'>t</span><span style='color:orange'>a</span><span style='color:orange'>f</span><span style='color:orange'>r</span><span style='color:orange'>a</span><span style='color:orange'>m</span><span style='color:orange'>e</span><span style='color:orange'>s</span><br><span style='color:orange'>i</span><span style='color:orange'>m</span><span style='color:orange'>p</span><span style='color:orange'>o</span><span style='color:orange'>r</span><span style='color:orange'>t</span><span style='color:orange'> </span><span style='color:orange'>p</span><span style='color:orange'>a</span><span style='color:orange'>n</span><span style='color:orange'>d</span><span style='color:orange'>a</span><span style='color:orange'>s</span><span style='color:orange'> </span><span style='color:orange'>a</span><span style='color:orange'>s</span><span style='color:orange'> </span><span style='color:orange'>p</span><span style='color:orange'>d</span><br><span style='color:orange'>d</span><span style='color:orange'>f</span><span style='color:orange'>=</span><span style='color:orange'>p</span><span style='color:orange'>d</span><span style='color:orange'>.</span><span style='color:orange'>D</span><span style='color:orange'>a</span><span style='color:orange'>t</span><span style='color:orange'>a</span><span style='color:orange'>F</span><span style='color:orange'>r</span><span style='color:orange'>a</span><span style='color:orange'>m</span><span style='color:orange'>e</span><span style='color:orange'>(</span><span style='color:orange'>{</span><span style='color:orange'>'</span><span style='color:orange'>c</span><span style='color:orange'>o</span><span style='color:orange'>l</span><span style='color:orange'>1</span><span style='color:orange'>'</span><span style='color:orange'>:</span><span style='color:orange'>r</span><span style='color:orange'>a</span><span style='color:orange'>n</span><span style='color:orange'>g</span><span style='color:orange'>e</span><span style='color:orange'>(</span><span style='color:orange'>1</span><span style='color:orange'>,</span><span style='color:orange'>1</span><span style='color:orange'>0</span><span style='color:orange'>+</span><span style='color:orange'>1</span><span style='color:orange'>)</span><span style='color:orange'>,</span><span style='color:orange'>'</span><span style='color:orange'>c</span><span style='color:orange'>o</span><span style='color:orange'>l</span><span style='color:orange'>2</span><span style='color:orange'>'</span><span style='color:orange'>:</span><span style='color:orange'>r</span><span style='color:orange'>a</span><span style='color:orange'>n</span><span style='color:orange'>g</span><span style='color:orange'>e</span><span style='color:orange'>(</span><span style='color:orange'>1</span><span style='color:orange'>1</span><span style='color:orange'>,</span><span style='color:orange'>2</span><span style='color:orange'>0</span><span style='color:orange'>+</span><span style='color:orange'>1</span><span style='color:orange'>)</span><span style='color:orange'>}</span><span style='color:orange'>)</span><br><span style='color:orange'>d</span><span style='color:orange'>f</span></code> ``` col1 col2 0 1 11 1 2 12 2 3 13 3 4 14 4 5 15 5 6 16 6 7 17 7 8 18 8 9 19 9 10 20 ``` ] .pull-right[ <center>R</center> <code class ='r hljs remark-code'><span style='color:CornflowerBlue'>#</span><span style='color:CornflowerBlue'>D</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>f</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>s</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>d</span><span style='color:CornflowerBlue'>f</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>=</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>d</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>t</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>.</span><span style='color:CornflowerBlue'>f</span><span style='color:CornflowerBlue'>r</span><span style='color:CornflowerBlue'>a</span><span style='color:CornflowerBlue'>m</span><span style='color:CornflowerBlue'>e</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>l</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>=</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>:</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>0</span><span style='color:CornflowerBlue'>)</span><span style='color:CornflowerBlue'>,</span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>o</span><span style='color:CornflowerBlue'>l</span><span style='color:CornflowerBlue'>2</span><span style='color:CornflowerBlue'>=</span><span style='color:CornflowerBlue'>c</span><span style='color:CornflowerBlue'>(</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>1</span><span style='color:CornflowerBlue'>:</span><span style='color:CornflowerBlue'>2</span><span style='color:CornflowerBlue'>0</span><span style='color:CornflowerBlue'>)</span><span style='color:CornflowerBlue'>)</span><br><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'> </span><span style='color:CornflowerBlue'>d</span><span style='color:CornflowerBlue'>f</span></code> ``` ## col1 col2 ## 1 1 11 ## 2 2 12 ## 3 3 13 ## 4 4 14 ## 5 5 15 ## 6 6 16 ## 7 7 17 ## 8 8 18 ## 9 9 19 ## 10 10 20 ``` ] --- #Dudas de programación .pull-left[ ![](dudas1.jpg) ![](dudas2.png) ![](dudas3.png) ] .pull-right[ 1. [stackoverflow](https://es.stackoverflow.com/) 1. [StackExchange](https://spanish.stackexchange.com/) 1. [GitHub Community](https://github.community/) 1. [Quora](https://es.quora.com/) 1. [reddit](https://www.reddit.com/) ![](dudas4.jpg) ![](dudas5.png) ] --- #Plataformas educativas .pull-left[ 1. [Datacamp](https://www.datacamp.com/) 1. [Coursera](https://es.coursera.org/) 1. [edx](https://www.edx.org/es) 1. [Udemy](https://www.udemy.com/) 1. [Lynda](https://www.lynda.com/) ] .pull-right[ 1. [Codecademy](https://www.codecademy.com/) 1. [Udacity](https://www.udacity.com/) 1. [w3schools](https://www.w3schools.com/) 1. [Programmr](http://www.programmr.com/) 1. [CODE AVENGERS](https://www.codeavengers.com/) ] ![](learn-to-code.jpg) --- #Recursos .pull-left[ * [R para principiantes](https://cran.r-project.org/doc/contrib/rdebuts_es.pdf) * [Métodos estadísticos con R y R Commander](https://cran.r-project.org/doc/contrib/Saez-Castillo-RRCmdrv21.pdf) * [Gráficos estadísticos con R](https://cran.r-project.org/doc/contrib/grafi3.pdf) * [Cheat Sheet R](https://rstudio.com/resources/cheatsheets/) * [R-Exercises](https://www.r-exercises.com/) * [R for Data Science](https://es.r4ds.hadley.nz/) ] .pull-right[ * [Practice Python](https://www.practicepython.org/) * [Towards Data Science](https://towardsdatascience.com/) * [TinyStats](https://tinystats.github.io/teacups-giraffes-and-statistics/01_introToR.html) * [Aplicaciones ML](https://github.com/firmai/industry-machine-learning/blob/master/README.md) * [Compilador online](https://rextester.com/) ] --- #Comunidades 1. [Python Colombia](https://www.python.org.co/) 1. [PyLadies Medellín](https://www.meetup.com/es-ES/Python-Ladies-Medellin/) 1. [Women Who Code Medellín](https://www.womenwhocode.com/medellin) 1. [She Codes Angular Medellín](https://www.meetup.com/es-ES/Python-Ladies-Medellin/) 1. [R-Ladies Medellín](https://www.meetup.com/es/rladies-medellin/) 1. [DATA SCIENCE FEM](https://www.datasciencefem.com/) --- class: center, middle #Gracias! ![](avatarc.png) .pull-down[ <a href="https://duvancho321.github.io/"> .white[
duvancho321.github.io] </a> <a href="https://twitter.com/DuvanNievesRui1"> .white[
@DuvanNievesRui1] </a> <a href="https://github.com/Duvancho321"> .white[
@Duvancho321] </a> <a href="https://rpubs.com/duvancho321_"> .white[
RPubs] </a> ]