{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\"AeroPython\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Características de los arrays de NumPy" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "_En este notebook veremos como las principales características de los arrays de NumPy y cómo mejoran la eficiencia de nuestro código._" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "El objeto tipo array que proporciona NumPy (Python ya dispone de un tipo array que sirve para almacenar elementos de igual tipo pero no proporciona toda la artillería matemática necesaria como para hacer operaciones de manera rápida y eficiente) se caracteriza por:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1) Homogeneidad de tipo:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Comencemos viendo que ocurre con las __listas__:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "[1, (1+2j), True, 'aerodinamica', [1, 2, 3]]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lista = [ 1, 1+2j, True, 'aerodinamica', [1, 2, 3] ]\n", "lista" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "En el caso de los __arrays__:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array(['1', '(1+2j)', 'True', 'aerodinamica'], \n", " dtype='\n", "####

¡Síguenos en Twitter!\n", "
\n", "###### Follow @AeroPython \n", "
\n", "###### Este notebook ha sido realizado por: Juan Luis Cano y Álex Sáez \n", "
\n", "##### \"Licencia
Curso AeroPython por Juan Luis Cano Rodriguez y Alejandro Sáez Mollejo se distribuye bajo una Licencia Creative Commons Atribución 4.0 Internacional." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "_Las siguientes celdas contienen configuración del Notebook_\n", "\n", "_Para visualizar y utlizar los enlaces a Twitter el notebook debe ejecutarse como [seguro](http://ipython.org/ipython-doc/dev/notebook/security.html)_\n", "\n", " File > Trusted Notebook" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "/* This template is inspired in the one used by Lorena Barba\n", "in the numerical-mooc repository: https://github.com/numerical-mooc/numerical-mooc\n", "We thank her work and hope you also enjoy the look of the notobooks with this style */\n", "\n", "\n", "\n", "El estilo se ha aplicado =)\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Esta celda da el estilo al notebook\n", "from IPython.core.display import HTML\n", "css_file = '../styles/aeropython.css'\n", "HTML(open(css_file, \"r\").read())" ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [default]", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.2" } }, "nbformat": 4, "nbformat_minor": 0 }