Volver a los cursos
AI018 Profesional

Guía del usuario de NumPy

Una revisión introductoria completa y guía técnica sobre NumPy, que cubre la instalación, manipulación de matrices, indexación, difusión y la integración con C/C++.

4.9
15.0h
891 estudiantes
5 lessons
0 me gusta
Inteligencia Artificial
Comenzar a aprender

Descripción del curso

📚 Resumen del contenido

Una revisión introductoria completa y una guía técnica sobre NumPy, que cubre la instalación, manipulación de matrices, indexación, difusión (broadcasting) e integración con C/C++.

Domina los fundamentos del cálculo científico en Python con la guía oficial de NumPy.

Autor: La comunidad de NumPy

Agradecimientos: Escrito por la comunidad de NumPy

🎯 Objetivos de aprendizaje

  1. Definir NumPy e identificar su papel en el ecosistema científico de Python.
  2. Explicar por qué NumPy es significativamente más rápido que los bucles estándar de Python mediante el concepto de vectorización.
  3. Ejecutar comandos de instalación para diversos entornos, incluyendo Pip, Conda y Raspberry Pi.
  4. Identificar e interpretar los atributos principales del ndarray, como ndim, shape y dtype.
  5. Ejecutar la creación y manipulación de matrices usando funciones como linspace, reshape, vstack y hstack.
  6. Aplicar operaciones elementales, funciones universales (ufuncs) y resolutores de álgebra lineal a conjuntos de datos numéricos.
  7. Gestionar la precisión de los datos y mitigar errores de desbordamiento usando los tipos escalares de NumPy y herramientas de información (iinfo, finfo).
  8. Implementar la ingesta flexible de datos desde disco usando genfromtxt con delimitadores personalizados, encabezados y selección de columnas.
  9. Aplicar las Reglas Generales de Difusión para predecir y controlar las interacciones entre matrices de formas diferentes.
  10. Gestionar referencias de memoria y evitar "trampas" en subclases personalizadas de ndarray usando el atributo .base.

Lecciones

Lesson

This lesson introduces NumPy as the foundational bridge between high-level Python applications and low-level hardware, focusing on the ndarray as a universal interface for scientific computing. Students will learn how the ndarray’s contiguous memory layout and homogeneous data structure enable high-performance, vectorized operations across the data science ecosystem.

This lesson introduces the NumPy ndarray as a memory-efficient, homogeneous alternative to Python lists, focusing on proper initialization and the performance benefits of contiguous memory. Students will learn to interpret core array attributes—such as shape, size, and data type—to understand how metadata defines the spatial geometry and memory footprint of numerical data.

This lesson covers precision management in NumPy, focusing on how fixed-size data types handle integer overflow and floating-point saturation. It also introduces robust data ingestion techniques using np.genfromtxt to handle irregular file formats and sanitize messy datasets.

This lesson explores the complexities of subclassing `numpy.ndarray`, focusing on the "Initialization Triad" and the critical role of the `__array_finalize__` hook in maintaining metadata. Students will learn to navigate the risks of behavioral fragility and identify when to choose subclassing for interoperability versus using composition for safer architectural design.

AI018: Extending NumPy with the C-API (Lesson 5) explores how to overcome performance bottlenecks like the interpreter tax and memory bloat by implementing high-performance C extensions. Students will learn to manage memory safely, utilize kernel fusion, and perform cache-aligned pointer arithmetic to optimize complex computational tasks.