PD Lab 4
Aim
To analyze and visualize data from a selected dataset on data.world using Python libraries such
as Matplotlib for plotting graphs and Streamlit for creating an interactive dashboard. The goal is
to explore trends, patterns, and insights from the data, presenting the findings in a
comprehensive dashboard.
Theory
1. Data Visualization:
Data visualization is the graphical representation of data and information. By using visual
elements like charts, graphs, and maps, data visualization tools provide an accessible way to
see and understand trends, outliers, and patterns in data.
2. Matplotlib:
Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations
in Python. It is highly customizable, making it a popular choice for creating various types of plots
like line graphs, bar charts, histograms, scatter plots, and more.
3. Streamlit:
Streamlit is an open-source Python library that makes it easy to create and share beautiful,
custom web apps for machine learning and data science. With a few lines of code, developers
can create interactive dashboards that allow users to explore and interact with the data.
4. Dataset Selection and Preparation:
The dataset for this project is sourced from data.world, a platform that hosts various datasets
across different domains. The dataset is first pre-processed to clean and structure the data
appropriately. This involves handling missing values, normalizing data, and selecting relevant
features for analysis.
5. Plotting with Matplotlib:
Multiple graphs are plotted using Matplotlib to represent different aspects of the dataset.
Examples include:
● Line Plot: To show trends over time.
● Bar Chart: To compare different categories.
● Scatter Plot: To explore relationships between variables.
● Histogram: To analyze the distribution of a single variable.
6. Dashboard Creation with Streamlit:
The Matplotlib plots are integrated into a Streamlit application to create an interactive
dashboard. Streamlit components like sliders, buttons, and text inputs are used to make the
dashboard dynamic, allowing users to filter and interact with the data.
Program
Output
Conclusion
The project successfully demonstrates the process of data visualization using Python,
Matplotlib, and Streamlit. By plotting various graphs, key insights and trends in the data were
identified, and the interactive dashboard created using Streamlit enables users to explore these
insights effectively. This approach highlights the power of combining data visualization with
interactive tools to make data-driven decisions more accessible and intuitive.