0% found this document useful (0 votes)
3 views1 page

DV Code A7

The document provides essential Python code snippets for various data visualization techniques using libraries like Matplotlib and Seaborn. It includes examples for creating line charts, bar charts, histograms, scatter plots, pie charts, box plots, and heatmaps, as well as handling CSV files and filtering data with Pandas. Each code snippet is accompanied by a brief description of its purpose.

Uploaded by

emo733419
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

DV Code A7

The document provides essential Python code snippets for various data visualization techniques using libraries like Matplotlib and Seaborn. It includes examples for creating line charts, bar charts, histograms, scatter plots, pie charts, box plots, and heatmaps, as well as handling CSV files and filtering data with Pandas. Each code snippet is accompanied by a brief description of its purpose.

Uploaded by

emo733419
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DATA VISUALIZATION IMPORTANT PYTHON CODES

1. Line Chart
import [Link] as plt

x=[1,2,3,4]
y=[10,20,15,30]

[Link](x,y)
[Link]("Line Chart")
[Link]()
2. Bar Chart
import [Link] as plt

x=["A","B","C"]
y=[5,7,3]

[Link](x,y)
[Link]("Bar Chart")
[Link]()
3. Histogram
import [Link] as plt

data=[1,2,2,3,3,4]

[Link](data)
[Link]("Histogram")
[Link]()
4. Scatter Plot
import [Link] as plt

x=[1,2,3,4]
y=[5,7,6,8]

[Link](x,y)
[Link]("Scatter Plot")
[Link]()
5. Pie Chart
import [Link] as plt

data=[40,35,25]

[Link](data)
[Link]("Pie Chart")
[Link]()
6. Read CSV File
import pandas as pd

data=pd.read_csv("[Link]")

print([Link]())
7. Filter Data
import pandas as pd

data=[Link]({
"Marks":[40,80,90]
})

print(data[data["Marks"]>50])
8. Handle Missing Values
import pandas as pd

data=[Link]({
"A":[1,None,3]
})

print([Link](0))
9. Box Plot
import [Link] as plt

data=[1,2,3,4,5]

[Link](data)
[Link]("Box Plot")
[Link]()
10. Heatmap
import seaborn as sns
import [Link] as plt

data=[[1,2],[3,4]]

[Link](data)

[Link]()

You might also like