Created
October 25, 2025 05:03
-
-
Save vtu27619/ac53cca18ac1adf25208a55bc373d04a to your computer and use it in GitHub Desktop.
Likitha
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Task10a | |
| import matplotlib.pyplot as plt | |
| languages = ['Java', 'Python', 'PHP', 'JavaScript', 'C#', 'C++'] | |
| popularity = [22.2, 17.6, 8.8, 8, 7.7, 6.7] | |
| plt.bar(languages, popularity, color='b') | |
| plt.title('Popularity of Programming Languages') | |
| plt.xlabel('Programming Languages') | |
| plt.ylabel('Popularity') | |
| plt.show() | |
| Task10b | |
| import matplotlib.pyplot as plt | |
| # Step 1 | |
| languages = ['Java', 'Python', 'PHP', 'JavaScript', 'C#', 'C++'] | |
| popularity = [22.2, 17.6, 8.8, 8, 7.7, 6.7] | |
| # Step 2 | |
| plt.pie(popularity, labels=languages, autopct='%1.1f%%') | |
| # Step 3 | |
| plt.title('Popularity of Programming Languages') | |
| plt.legend(languages, loc="best") | |
| # Step 4 | |
| plt.show() | |
| Task10c | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| # Read CSV | |
| df = pd.read_csv("students.csv") | |
| # x-axis = student names | |
| x = df["Name"] | |
| # Plot each test as a separate line | |
| plt.plot(x, df["Test1"], marker='s', label="Test1") | |
| plt.plot(x, df["Test2"], marker='o', label="Test2") | |
| plt.plot(x, df["Test3"], marker='*', label="Test3") | |
| plt.plot(x, df["Test4"], marker='x', label="Test4") | |
| plt.ylabel("Marks") | |
| plt.title("Student Marks Across Tests") | |
| plt.legend() | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment