-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata_visual.py
More file actions
39 lines (31 loc) · 1.11 KB
/
data_visual.py
File metadata and controls
39 lines (31 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import pandas as pd
import matplotlib.pyplot as plt
def data_vis():
print('\t\tWelcome to Attendace Stats')
x = input('Enter the Name:\t')
test_data = pd.read_csv(r'C:\Users\aaris\Downloads\Data-Visualization-Using-Matplotlib-master\Test.csv')
i = test_data[test_data.Name == x]
print(i)
plt.bar(i.Subject,i.Attendance)
plt.legend([x])
plt.xlabel('Subject Code')
plt.ylabel('Attendace Percentage')
plt.grid(True)
plt.title('Attendance of every subject')
plt.show()
result = test_data[test_data.Subject =='AVG TH + PR']
print(result)
def data_vis1(x):
print('\t\tWelcome to Attendace Stats')
test_data = pd.read_csv(r'C:\Users\aaris\Downloads\Data-Visualization-Using-Matplotlib-master\Test.csv')
i = test_data[test_data.Name == x]
print(i)
plt.bar(i.Subject,i.Attendance)
plt.legend([x])
plt.xlabel('Subject Code')
plt.ylabel('Attendace Percentage')
plt.grid(True)
plt.title('Attendance of every subject')
plt.tight_layout(True)
plt.subplots_adjust(left = 0.05, right = 1.0)
plt.show()