Dashboard Increíble con Python y Streamlit ⚡ ¡Crea Apps Pro sin HTML en solo 15 minutos!

Dashboard Increíble con Python y Streamlit ⚡ ¡Crea Apps Pro sin HTML en solo 15 minutos!

Creating a Professional Dashboard with Python and Streamlit

Introduction to the Project

  • The speaker introduces the concept of creating a professional-looking dashboard using Python, emphasizing that it can be done quickly and for free.
  • Streamlit is introduced as a tool that transforms standard Python code into an intuitive web application without needing HTML knowledge.

Setting Up the Environment

  • Instructions are provided to create a project folder named "dashboard" and open it in Visual Studio Code.
  • The speaker discusses installing necessary libraries: Streamlit for the interface, pandas for data manipulation, and Plotly for graphics. A virtual environment is recommended but not mandatory.

Initializing the Application

  • The initial setup involves importing libraries: Streamlit as st, pandas as pd, and Plotly's express module.
  • Configuration of the Streamlit page is demonstrated, including setting the title ("My Dashboard Pro") and layout options.

Creating Sample Data

  • The speaker explains how to create sample data representing sales figures from January to June, which will be used in a DataFrame.
  • A new title ("Dashboard Ejecutivo Pro") is added to differentiate between sections within the app.

Adding Content to the Dashboard

  • Markdown formatting is introduced for adding text elements like titles; specifically, level three headings are used for "Real-Time Analysis."
  • Four columns are created using st.columns, allowing organized placement of metrics within each column.

Displaying Metrics

  • Metrics are generated using st.metric to display total sales alongside their calculated sum from the DataFrame.

Creating Interactive Metrics and Graphs in Data Analysis

Setting Up Metrics

  • The discussion begins with the creation of a dynamic metric that allows for comparison with previous months, ensuring values are adjustable through formulas rather than static numbers.
  • A second metric is introduced to track active clients, showing an increase of 23 clients, which updates intuitively on the dashboard.
  • The third metric focuses on calculating monthly averages for sales, formatted as integers without decimals, while also incorporating an 8% growth rate.
  • A fourth metric is established to represent Return on Investment (ROI), using a constant value of 245 and a growth percentage of 15%, contributing to the overall dashboard setup.

Creating Interactive Graphs

  • An interactive line graph is created using Plotly Express, plotting sales data against months with appropriate titles and markers for clarity.
  • The layout of the graph can be customized; users are encouraged to select templates that suit their preferences, such as 'plotlif dark' for better visibility.
  • Users can modify graph types and layouts dynamically. Errors encountered during initial setups are addressed promptly to ensure smooth functionality.

Implementing Circular Graphs

  • A circular chart is introduced due to its popularity among viewers; it visualizes client distribution by region effectively.
  • This pie chart utilizes data from the dataframe and allows users to interactively explore client distributions across different regions.

Enhancing User Interaction

  • Features like full-screen viewing and image downloading options enhance user experience when interacting with graphs.
  • Users can zoom in/out on charts for detailed analysis; these functionalities contribute significantly to data exploration.

Adding Filters for Data Control

  • A sidebar filter is implemented using Streamlit's sidebar feature, allowing users to control data views based on selected criteria such as month or region.

Filtering Data in Streamlit

Understanding Unique Filters for Regions

  • The speaker discusses filtering data by region, specifically focusing on the "punic" region to extract unique regions from the dataset.
  • It is noted that while months are unique and do not require a filter, regions may repeat (e.g., "norte" appears three times), necessitating the use of a unique filter.

Creating Filtered DataFrames

  • A variable named dato filtrado is introduced to store filtered data based on whether a selected region exists within the filter criteria.
  • The speaker demonstrates how selecting different regions affects the visibility of the DataFrame; it only displays when at least one region is selected.

Interactivity with Filters

  • The importance of interactivity is highlighted; selecting or deselecting regions dynamically alters the displayed DataFrame content.
  • Suggestions are made for implementing additional filters, such as month selection, emphasizing that these should be placed strategically in the code for effective functionality.

Dashboard Creation Insights

  • The speaker expresses satisfaction with creating a professional-looking dashboard using Streamlit, indicating this is just an initial step in mastering the tool.

Community Engagement and Future Learning Opportunities

Video description

¿Cansado de dashboards aburridos que parecen salidos de Excel 2003? 😩 Hoy vas a aprender a crear un dashboard espectacular, totalmente interactivo y con un diseño de nivel profesional… ¡usando solo Python y la magia de Streamlit! 🚀 Código (Patreon): https://www.patreon.com/posts/dashboard-con-y-136901315 Únete a este canal para apoyarme: https://www.youtube.com/channel/UCTyCe-0QDRju-yC5Cr83eeQ/join ¿Regalame un Café?: https://ko-fi.com/ivespino Curso de Python desde cero 2023: https://youtu.be/fJ4KoCeKyeQ ✈ Unete a nuestra comunidad de Telegram: https://t.me/+F9c-RdxQYRk4YTdh 💎Únete a nuestra comunidad de Discord: https://discord.gg/ZGWhzKz2qj 📥Correo de Contacto: ivespinops@gmail.com En este video exprés te enseño cómo construir desde cero una aplicación web profesional para visualizar datos en tiempo real. No necesitas saber HTML, ni CSS, ni JavaScript. Solo saber escribir print("Hola mundo") y estar listo para impresionar a tu jefe, a tus clientes o a ti mismo 😎 🔥 ¿Qué vas a lograr con este tutorial? ✅ Instalar todo el entorno en menos de 1 minuto ✅ Crear una estructura visual potente con Streamlit ✅ Añadir métricas dinámicas como Ventas, ROI y Clientes Activos ✅ Usar gráficos interactivos con Plotly (¡sí, con modo oscuro!) ✅ Filtrar datos en tiempo real con una sidebar profesional ✅ Ejecutar tu app con un solo comando: streamlit run dashboard.py 📊 Este es el tipo de dashboard que transforma tu CV, tu portafolio o tu negocio. Y lo mejor: ¡parece que lo hizo una agencia de diseño! 🤯 👉 Perfecto para: 🔹 Científicos de datos que quieren presentar resultados con estilo 🔹 Analistas que necesitan visualizar KPIs sin depender de BI tools caras 🔹 Freelancers que quieren impresionar a sus clientes 🔹 Emprendedores que buscan dashboards potentes sin gastar en desarrollo 💼 ¿Qué tecnologías usamos? 🔧 Python 🔧 Streamlit 🔧 Pandas 🔧 Plotly 🔧 Terminal (solo un comando y listo) 🎨 Además, te enseño a usar trucos visuales como: 🔹 st.set_page_config para personalizar tu app 🔹 Métricas con flechas verdes de impacto visual 🔹 Layouts en columnas para un look moderno 🔹 Gráficos de línea + gráficos circulares en modo pro 🔹 Sidebar con filtros para que el usuario interactúe 💡 ¿Por qué Streamlit? ✔️ Código simple, resultado impresionante ✔️ Ideal para prototipos rápidos o apps de datos internas ✔️ Se ve genial en cualquier navegador ✔️ ¡Y es 100% gratis! 🎁 BONUS: En la descripción te dejo el código completo para que lo copies, ajustes y conviertas en tuyo. Usa este proyecto para practicar, para mostrar en entrevistas o como base para tu próxima app de análisis 📈 🧠 Y si quieres ir más allá: Dime en los comentarios si quieres que haga una versión avanzada con conexión a bases de datos reales, despliegue en la nube, y autenticación de usuarios. ¡Hay mucho por construir juntos! 👀 NO TE OLVIDES: 👍 Dale LIKE si este tutorial te dio ideas 💬 Comenta qué parte te gustó más o qué funcionalidad quieres ver 📩 Compártelo con ese amigo que aún usa Excel para todo 🔔 SUSCRÍBETE para no perderte la próxima joya de automatización y visualización #Streamlit #Python #Dashboard #DataScience #VisualizaciónDeDatos #TutorialPython #Automatización #AppsConPython #Plotly #ProgramaciónSinHTML