KnowledgeBoat Logo
|

Informatics Practices

Collect data about colleges in Delhi University or any other university of your choice and number of courses they run for Science, Commerce and Humanities, store it in a CSV file and present it using a bar plot.

PyPlot

3 Likes

Answer

import pandas as pd
import matplotlib.pyplot as plt

data = {"Stream": ["Science", "Commerce", "Humanities"], 
        "Number of Courses": [12, 10, 15] 
}

df = pd.DataFrame(data)
df.to_csv('du_colleges.csv', index=False)

df = pd.read_csv("du_colleges.csv")
plt.bar(df["Stream"], df["Number of Courses"])
plt.xlabel("Stream")
plt.ylabel("Number of Courses")
plt.title("Number of Courses in Each Stream")
plt.show()
Output
Collect data about colleges in Delhi University or any other university of your choice and number of courses they run for Science, Commerce and Humanities, store it in a CSV file and present it using a bar plot. Data Visualization using Matplotlib, Informatics Practices Preeti Arora Solutions CBSE Class 12

Answered By

2 Likes


Related Questions