-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaiml_task.py
More file actions
79 lines (54 loc) · 2.12 KB
/
Copy pathaiml_task.py
File metadata and controls
79 lines (54 loc) · 2.12 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
######################################Bar-Graph-1
import matplotlib.pyplot as plt
import pandas as pd
data = pd.read_csv(r"C:\Users\LENOVO\Desktop\aiml\spotify-2023.csv", encoding='latin1')
released_year = data['released_year']
in_spotify_playlists = data['in_spotify_playlists']
plt.plot(released_year, in_spotify_playlists, c='b', linestyle="solid", linewidth=3)
plt.title("Most Famous Songs and Released Years")
plt.barh(released_year, in_spotify_playlists, color='r')
plt.xlabel("in_spotify_playlists")
plt.ylabel("released_year")
plt.show()
##############################################pie chart-1
##import matplotlib.pyplot as plt
##import pandas as pd
##
##data = pd.read_csv(r"C:\Users\LENOVO\Desktop\aiml\spotify-2023.csv", encoding='latin1')
##
##labels = data['released_year']
##sizes = data['in_spotify_playlists']
##
##
##plt.figure(figsize=(8, 8))
##plt.pie(sizes, labels=labels, autopct='%1.1f%%', startangle=140)
##plt.title("Most Famous Songs and Released Years")
##plt.show()
############################################BarGraph-2
##import matplotlib.pyplot as plt
##import pandas as pd
##
##data = pd.read_csv(r"C:\Users\LENOVO\Desktop\aiml\spotify-2023.csv", encoding='latin1')
##
##released_year = data['released_year']
##in_spotify_playlists = data['in_spotify_playlists']
##
##plt.bar(released_year, in_spotify_playlists, color='yellow')
##plt.title("Most Famous Songs and Released Years",color='red',fontsize=20)
##plt.xlabel("Released Year",color='blue',fontsize=18)
##plt.ylabel("in_spotify_playlists",color='blue',fontsize=18)
##plt.show()
############################################BarGraph-3
##import matplotlib.pyplot as plt
##import pandas as pd
##
##data = pd.read_csv(r"C:\Users\LENOVO\Desktop\aiml\spotify-2023.csv", encoding='latin1')
##
##released_year = data['in_deezer_charts']
##in_spotify_playlists = data['released_month']
##
##plt.bar(released_year, in_spotify_playlists, color='g')
##plt.title("Most Famous Songs and Released Years",color='red',fontsize=20)
##plt.xlabel("in_deezer_charts",color='blue', fontsize=18)
##plt.ylabel("released_month",color='blue', fontsize=18)
##plt.show()