Join this channel to learn data science, artificial intelligence and machine learning with funny quizzes, interesting projects and amazing resources for free
For collaborations: @love_data
Post #3926
5.13K
โ
Python for Data Science: Part-4
Data Visualization with Matplotlib, Seaborn Plotly ๐๐
1๏ธโฃ Matplotlib โ Basic Plotting
Great for simple line, bar, and scatter plots.
Import and Line Plot
Bar Plot
2๏ธโฃ Seaborn โ Statistical Visualization
Built on Matplotlib with better styling.
Import and Plot
Other Seaborn Plots
3๏ธโฃ Plotly โ Interactive Graphs
Great for dashboards and interactivity.
Basic Line Plot
๐ฏ Why Visualization Matters
โข Helps spot patterns in data
โข Makes insights clear and shareable
โข Supports better decision-making
Practice Task:
โข Create a line plot using matplotlib
โข Use seaborn to plot a boxplot for scores
โข Try any interactive chart using plotly
๐ฌ Tap โค๏ธ for more
Data Visualization with Matplotlib, Seaborn Plotly ๐๐
1๏ธโฃ Matplotlib โ Basic Plotting
Great for simple line, bar, and scatter plots.
Import and Line Plot
import matplotlib.pyplot as plt
x = [1, 2, 3, 4]
y = [10, 20, 25, 30]
plt.plot(x, y)
plt.title("Line Plot")
plt.xlabel("X-axis")
plt.ylabel("Y-axis")
plt.show()
Bar Plot
names = ["A", "B", "C"]
scores = [80, 90, 70]
plt.bar(names, scores)
plt.title("Scores by Name")
plt.show()
2๏ธโฃ Seaborn โ Statistical Visualization
Built on Matplotlib with better styling.
Import and Plot
import seaborn as sns
import pandas as pd
df = pd.DataFrame({
"Name": ["Riya", "Aman", "John", "Sara"],
"Score": [85, 92, 78, 88]
})
sns.barplot(x="Name", y="Score", data=df)
Other Seaborn Plots
sns.histplot(df["Score"]) # Histogram
sns.boxplot(x=df["Score"]) # Box plot
3๏ธโฃ Plotly โ Interactive Graphs
Great for dashboards and interactivity.
Basic Line Plot
import plotly.express as px
df = pd.DataFrame({
"x": [1, 2, 3],
"y": [10, 20, 15]
})
fig = px.line(df, x="x", y="y", title="Interactive Line Plot")
fig.show()
๐ฏ Why Visualization Matters
โข Helps spot patterns in data
โข Makes insights clear and shareable
โข Supports better decision-making
Practice Task:
โข Create a line plot using matplotlib
โข Use seaborn to plot a boxplot for scores
โข Try any interactive chart using plotly
๐ฌ Tap โค๏ธ for more
- โค 11

