Skip to main content

Álgebra lineal simplificada con integración a Google Sheets para estudiantes

Project description

📚 Álgebra Lineal con Google Sheets

Álgebra lineal simplificada para estudiantes con integración perfecta a Google Sheets.

Permite a estudiantes y profesores trabajar con matrices almacenadas en Google Sheets usando Python de forma intuitiva y sencilla. Perfecto para cursos de álgebra lineal, análisis numérico y ciencias de datos.

🚀 Instalación

pip install algebra-lineal-sheets

¡Y listo! No necesitas configurar nada más.

📋 Uso Básico

1. Preparar Google Sheet

  • Crear Google Sheet llamado matrices
  • Añadir pestañas con nombres: A, B, v, etc.
  • Llenar con datos numéricos (sin texto ni fórmulas)

2. Usar en Python

# Importar y configurar (una vez por sesión)
from algebra_lineal import *
configurar()

# Ver qué matrices tienes disponibles
workspace()

# Importar matrices específicas
importar('A', 'B', 'v')

# Realizar operaciones de álgebra lineal
C = A @ B                      # Multiplicación matricial
suma = A + B                   # Suma de matrices
Ainv = np.linalg.inv(A)       # Matriz inversa
det_A = np.linalg.det(A)      # Determinante

# Exportar resultados de vuelta a Google Sheets
exportar('C', 'suma', 'Ainv')

📊 Ejemplo Completo

from algebra_lineal import *
import numpy as np

# Configurar conexión con Google Sheets
configurar()

# Ver workspace
workspace()
# 🏢 WORKSPACE: 'matrices'
# ===========================================================================
# #   NOMBRE               DIMENSIONES  TIPO           
# ---------------------------------------------------------------------------
# 1   A                    3×3          📋 Matriz      
# 2   B                    3×3          📋 Matriz      
# 3   v                    3×1          📉 Vector columna

# Importar matrices necesarias
importar('A', 'B', 'v')

# Resolver sistema de ecuaciones Ax = b
b = v  # Usar vector v como término independiente
x = np.linalg.solve(A, b)

# Verificar solución
verificacion = A @ x - b
error = np.linalg.norm(verificacion)

print(f"Solución: x = {x}")
print(f"Error: {error:.2e}")

# Exportar resultados
exportar('x', 'verificacion')

🔧 Funciones Disponibles

Función Descripción Ejemplo
configurar() Configuración inicial configurar() o configurar(sheet='prop2026')
workspace() Ver matrices en Sheets workspace()
importar() Importar matrices importar('A', 'B')
exportar() Exportar resultados exportar('C')
cambiar_sheet() Cambiar archivo cambiar_sheet('proyecto2')
ayuda() Ayuda completa ayuda()

📚 Para Estudiantes

Google Colab (Recomendado)

# 1. Instalar paquete
!pip install algebra-lineal-sheets

# 2. Importar y configurar
from algebra_lineal import *
configurar()

# 3. ¡Empezar a trabajar!
workspace()
importar('A', 'B')
resultado = A @ B
exportar('resultado')

Operaciones Comunes

# Después de importar matrices A, B, v
C = A @ B                          # Multiplicación matricial
suma = A + B                       # Suma
transpuesta = A.T                  # Transpuesta
inversa = np.linalg.inv(A)         # Inversa (si existe)
determinante = np.linalg.det(A)    # Determinante
autovalores = np.linalg.eigvals(A) # Autovalores
rango = np.linalg.matrix_rank(A)   # Rango
norma = np.linalg.norm(v)          # Norma de vector

👨‍🏫 Para Profesores

Ventajas Pedagógicas

  • Enfoque en matemáticas: Los estudiantes se concentran en álgebra lineal, no en programación
  • Datos modificables: Cambiar valores en Google Sheets sin tocar código
  • Colaborativo: Fácil compartir matrices entre estudiantes
  • Visual: Ver resultados inmediatamente en Google Sheets
  • Escalable: Funciona igual para 10 o 1000 estudiantes

Configuración de Clase

  1. Crear plantilla: Google Sheet con matrices ejemplo
  2. Compartir plantilla: Estudiantes hacen copia
  3. Dar instrucciones simples:
    !pip install algebra-lineal-sheets
    from algebra_lineal import *
    configurar()
    

Ejemplo de Ejercicio

# Ejercicio: Transformaciones lineales
importar('T', 'v1', 'v2', 'v3')  # Matriz T y vectores

# Aplicar transformación
w1 = T @ v1
w2 = T @ v2  
w3 = T @ v3

# Analizar propiedades
det_T = np.linalg.det(T)
es_invertible = abs(det_T) > 1e-10

# Exportar análisis
exportar('w1', 'w2', 'w3', 'det_T')

🛠️ Configuración Avanzada

Múltiples Archivos

Por defecto el paquete trabaja con un Google Sheet llamado matrices. Para usar otro archivo (por ejemplo prop2026) tienes 3 opciones:

# Opción 1: elegir el archivo al configurar
configurar(sheet='prop2026')

# Opción 2: cambiar de archivo en cualquier momento
cambiar_sheet('prop2026')
workspace()
importar('A', 'B')

# Opción 3: usar otro archivo solo para una operación puntual
importar('A', sheet_name='prop2026')

⚠️ Importante: importar('prop2026') NO abre el archivo prop2026 — busca una pestaña llamada prop2026 dentro del archivo activo. Para cambiar de archivo usa cambiar_sheet('prop2026').

Verificar Variables

# Ver qué variables están disponibles para exportar
listar_variables_exportables()

❓ Solución de Problemas

Error: "No se pudo abrir 'matrices'"

  • ✅ Verificar que el Google Sheet existe
  • ✅ Verificar que se llama exactamente 'matrices'
  • ✅ Verificar permisos de acceso

Importa las matrices de OTRO archivo (no el que quiero)

  • ✅ El paquete siempre usa el archivo activo (por defecto matrices)
  • ✅ Cambiar con cambiar_sheet('mi_archivo') o configurar(sheet='mi_archivo')
  • ✅ Ver qué archivo está activo: aparece en los mensajes de importar() y workspace()

Error: "Variable no encontrada"

  • ✅ Ejecutar importar() antes de usar variables
  • ✅ Verificar nombres exactos con workspace()

Error de autenticación

  • ✅ Ejecutar configurar() nuevamente
  • ✅ En Colab: Runtime → Restart and run all

🔄 Actualización

pip install --upgrade algebra-lineal-sheets

📦 Requisitos

  • Python 3.8+
  • numpy >= 1.20.0
  • gspread >= 5.0.0
  • google-auth >= 2.0.0

Se instalan automáticamente con el paquete.

📄 Licencia

MIT License - Ver LICENSE para más detalles.

🤝 Contribuir

¡Las contribuciones son bienvenidas!

📧 Contacto

🔗 Enlaces Útiles


¡Si te resulta útil, compártelo con otros profesores!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

algebra_lineal_sheets-1.0.5.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

algebra_lineal_sheets-1.0.5-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file algebra_lineal_sheets-1.0.5.tar.gz.

File metadata

  • Download URL: algebra_lineal_sheets-1.0.5.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for algebra_lineal_sheets-1.0.5.tar.gz
Algorithm Hash digest
SHA256 b5acfe855816a31eb51176de2b5f74bca1b61c84b2a030db64368b61cc5a49f4
MD5 859b1e935b8e2db0fa98acf349b364d7
BLAKE2b-256 ac2aad13dc65394c2b2f1515bf6317852943ac5ad62ad6e2809ad2bdada74861

See more details on using hashes here.

File details

Details for the file algebra_lineal_sheets-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for algebra_lineal_sheets-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5b070ed8687a65b8b6253259d2683d308007d042668bbbf792067e0d8e671aa7
MD5 ae388e8c3ef5d5f5c1243225f7ad01a1
BLAKE2b-256 ea26e880e60530c323763fd931c2d1ac8249d129ff51fba97a688d21054e8670

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page