Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Python Tutorial
  • Interview Questions
  • Python Quiz
  • Python Glossary
  • Python Projects
  • Practice Python
  • Data Science With Python
  • Python Web Dev
  • DSA with Python
  • Python OOPs
Open In App
Next Article:
How to play a Spotify audio with Python?
Next article icon

How to use PyGWalker with Streamlit in Python

Last Updated : 31 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Streamlit is an open-source Python library that allows developers to create beautiful, interactive web applications for data science and machine learning projects with ease. PyGWalker (Python Graphic Walker) is an innovative data visualization tool that combines the simplicity of Python with the power of modern web-based visualization. In this article, we will explore how to use PyGWalker with Streamlit to create dynamic and interactive data visualizations.

How to Install PyGWalker?

Before we dive into the examples, let's start by installing the necessary libraries. Both Streamlit and PyGWalker can be installed via pip, the Python package manager. Open your terminal or command prompt and run the following commands:

pip install streamlit
pip install pygwalker

Once the installation is complete, you are ready to create your first interactive visualization using PyGWalker and Streamlit.

Basic Integration ( 3 Columns )

This Streamlit app demonstrates how to create a simple data visualization using PyGWalker. It loads a sample dataset with three columns and displays it in an interactive table format within the app. The app is titled "PyGWalker with Streamlit - Basic Example" and showcases the dataset using `st.dataframe()` for clear and easy viewing.

Python
import streamlit as st import pandas as pd import pygwalker as pyg  # Load sample dataset df = pd.DataFrame({     'A': range(1, 11),     'B': [x ** 2 for x in range(1, 11)],     'C': ['Category1', 'Category2'] * 5 })  # Title for the Streamlit app st.title("PyGWalker with Streamlit - Basic Example")  # Display the dataset st.write("### Sample Data") st.dataframe(df) 

Run your Streamlit App

Save the script as app.py and run it using the following command in your terminal:

streamlit run app.py
1

Interactive Data Selection and Visualization (4 Column)

This Streamlit app loads a sample dataset with four columns and displays it interactively using st.dataframe(). Titled "PyGWalker with Streamlit - Interactive Example," it provides a clear view of the dataset, facilitating easy data exploration and visualization. The app leverages PyGWalker for enhanced interactive data analysis.

Python
import streamlit as st import pandas as pd import pygwalker as pyg  # Load sample dataset df = pd.DataFrame({     'A': range(1, 11),     'B': [x ** 2 for x in range(1, 11)],     'C': ['Category1', 'Category2'] * 5,     'D': [10 - x for x in range(1, 11)] })  # Title for the Streamlit app st.title("PyGWalker with Streamlit - Interactive Example")  # Display the dataset st.write("### Sample Data") st.dataframe(df) 

Run your Streamlit App

Save the script as app.py and run it using the following command in your terminal:

streamlit run app.py
2

Conclusion

Combining PyGWalker with Streamlit opens up a world of possibilities for creating interactive data visualizations in Python. Streamlit's ease of use and PyGWalker's powerful visualization capabilities make them a perfect match for data scientists and analysts looking to quickly prototype and share their findings. By following the steps outlined in this article, you can start creating your own interactive data visualizations and enhance your data exploration experience. Happy coding!


Next Article
How to play a Spotify audio with Python?

K

kasoti2002
Improve
Article Tags :
  • Python
  • Python-streamlit
Practice Tags :
  • python

Similar Reads

  • Create a ChatBot with OpenAI and Streamlit in Python
    ChatGPT is an advanced chatbot built on the powerful GPT-3.5 language model developed by OpenAI.There are numerous Python Modules and today we will be discussing Streamlit and OpenAI Python API to create a chatbot in Python streamlit. The user can input his/her query to the chatbot and it will send
    5 min read
  • Streamline Plots in Plotly using Python
    A Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization libra
    2 min read
  • 3D Streamtube Plots using Plotly in Python
    Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library
    2 min read
  • How to play a Spotify audio with Python?
    In this article, we will cover how to play Spotify audio with Python. Spotify is one of the world’s largest music streaming service providers. In this article we will access Spotify using Spotipy, It is a lightweight Python library for the Spotify Web API with Spotify one can get full access to all
    5 min read
  • Create Interactive Dashboard in Python using Streamlit
    An interactive and Informative dashboard is very necessary for better understanding our data sets. This will help a researcher for getting a better understanding of our results and after that, a researcher can make some necessary changes for better understanding. Visual Reports is must better than i
    6 min read
  • How to set up pygame with Eclipse?
    In this article, we will see how to set up Pygame with Eclipse, Before moving ahead let us understand some of the basic terminologies to understand all things more clearly. What is Pygame? Pygame is an open-source, cross-platform library that was designed for coding video games. Building 2-D games u
    4 min read
  • How to setup Python, PyEnv & Poetry on Windows
    Setting up a robust Python development environment on Windows involves installing Python itself, managing multiple versions with PyEnv, and handling dependencies and project environments with Poetry. This guide will walk you through each step to get your system ready for efficient and organized Pyth
    3 min read
  • How to Install a Python Package with a .whl File?
    To install a Python package using a .whl (wheel) file, you'll need to follow a few simple steps. The first method involves using PowerShell along with pip and the cd command to change the directory to where your .whl file is located. The second method uses PowerShell and pip directly, without changi
    4 min read
  • Number Guessing Game Using Python Streamlit Library
    The game will pick a number randomly from 1 to 100 and the player needs to guess the exact number guessed by calculating the hint. The player will get 7 chances to guess the number and for every wrong guess game will tell you if the number is more or less or you can take a random hint to guess the n
    5 min read
  • Tweet Sentiment Analysis Using Python Streamlit
    This article covers the sentiment analysis of by parsing the tweets fetched from Twitter using the streamlit Python framework. What is Sentiment Analysis? Sentiment Analysis is the process of ‘computationally’ determining whether a piece of writing is positive, negative or neutral. It’s also known a
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences