📈 Billboard Data
Contents
📈 Billboard Data#
This notebook uses the billboard.py library.
from datetime import date
from collections import Counter
from dateutil.relativedelta import relativedelta
import billboard
import pandas as pd
import numpy as np
today = date.today().strftime("%d/%m/%Y")
print('Ran on: ' + today)
Ran on: 02/12/2022
currentHot100 = billboard.ChartData('hot-100')
def convert_ChartData_to_array(chart):
songs = []
for chartEntry in chart:
song = {
'title': chartEntry.title,
'artist': chartEntry.artist,
'peakPos': chartEntry.peakPos,
'lastPos': chartEntry.lastPos,
'weeks': chartEntry.weeks,
'rank': chartEntry.rank,
'isNew': chartEntry.isNew
}
songs.append(song)
return songs
hot100Array = convert_ChartData_to_array(currentHot100)
hot100DF = pd.DataFrame(hot100Array)
hot100DF
title | artist | peakPos | lastPos | weeks | rank | isNew | |
---|---|---|---|---|---|---|---|
0 | Anti-Hero | Taylor Swift | 1 | 1 | 5 | 1 | False |
1 | Rich Flex | Drake & 21 Savage | 2 | 2 | 3 | 2 | False |
2 | Unholy | Sam Smith & Kim Petras | 1 | 3 | 9 | 3 | False |
3 | Bad Habit | Steve Lacy | 1 | 4 | 21 | 4 | False |
4 | All I Want For Christmas Is You | Mariah Carey | 1 | 25 | 53 | 5 | False |
... | ... | ... | ... | ... | ... | ... | ... |
95 | Die For You | Joji | 53 | 72 | 3 | 96 | False |
96 | Down Home | Jimmie Allen | 88 | 0 | 4 | 97 | False |
97 | Going, Going, Gone | Luke Combs | 98 | 99 | 2 | 98 | False |
98 | Middle Of The Ocean | Drake | 15 | 67 | 3 | 99 | False |
99 | More M’s | Drake & 21 Savage | 18 | 69 | 3 | 100 | False |
100 rows × 7 columns
📆 Sort by Weeks on the Hot 100#
hot100DF.sort_values(by='weeks', ascending=False)
title | artist | peakPos | lastPos | weeks | rank | isNew | |
---|---|---|---|---|---|---|---|
19 | Wasted On You | Morgan Wallen | 9 | 23 | 54 | 20 | False |
4 | All I Want For Christmas Is You | Mariah Carey | 1 | 25 | 53 | 5 | False |
5 | Rockin' Around The Christmas Tree | Brenda Lee | 2 | 41 | 47 | 6 | False |
8 | Jingle Bell Rock | Bobby Helms | 3 | 50 | 44 | 9 | False |
7 | As It Was | Harry Styles | 1 | 5 | 34 | 8 | False |
... | ... | ... | ... | ... | ... | ... | ... |
85 | Heart Like A Truck | Lainey Wilson | 86 | 86 | 2 | 86 | False |
75 | Break My Heart | Rod Wave | 76 | 91 | 2 | 76 | False |
97 | Going, Going, Gone | Luke Combs | 98 | 99 | 2 | 98 | False |
87 | Down In Atlanta | Pharrell Williams & Travis Scott | 88 | 0 | 1 | 88 | True |
94 | Got It Right | Rod Wave | 95 | 0 | 1 | 95 | True |
100 rows × 7 columns
🔥 The hotest Artists#
Find the Artists that has had the largest number of songs on the Hot 100 in the last 10 years.
The date taken is today and then incrementally minuses a year for the past 10 years.
I dont want to break my computer by doing every single day of every singe year.
def all_entries_last_10_years(chartName):
currentDate = date.today()
tenYearCharts = []
for i in range(1, 10):
yearChart = billboard.ChartData(chartName, date= currentDate.strftime("%Y-%m-%d"))
yearChartAsArray = convert_ChartData_to_array(yearChart)
year = currentDate.year
tenYearCharts = np.concatenate([tenYearCharts, yearChartAsArray])
currentDate = currentDate - relativedelta(years=1)
return tenYearCharts
tenYearHot100 = all_entries_last_10_years('hot-100')
def get_artist_count(chart):
artists = []
for chartEntry in chart:
artists.append(chartEntry['artist'])
artistCount = Counter(artists)
return artistCount
hot100ArtistCountDF = pd.DataFrame.from_dict(get_artist_count(tenYearHot100), orient='index')
hot100ArtistCountDF.head()
0 | |
---|---|
Taylor Swift | 24 |
Drake & 21 Savage | 10 |
Sam Smith & Kim Petras | 1 |
Steve Lacy | 1 |
Mariah Carey | 5 |
💜 Kpop#
kpopTenYearChart = all_entries_last_10_years('billboard-korea-100')
kpopArtistCountDF = pd.DataFrame.from_dict(get_artist_count(kpopTenYearChart), orient='index')
kpopArtistCountDF
0 | |
---|---|
sokodomo Feat. Zion.T, Wonstein, Prod. by Slom | 1 |
IU | 32 |
Lee Mujin | 3 |
BE'O Feat. MINO Prod. GRAY | 1 |
Gaeko, Ourealgoat, SINCE, Ahn Byeong Woong, Tabber, Gwangil Jo Prod. CODE KUNST | 1 |
... | ... |
Brown Eyed Soul | 5 |
BewhY | 5 |
GIRIBOY (Feat. Jvcki Wai) | 5 |
Hwang In Wook (Prod. By Jeon Tae Ik) | 5 |
SuperM | 5 |
180 rows × 1 columns
print(billboard.ChartData('korea'))
korea chart (current)
---------------------
1. 'Gone Not Around Any Longer' by Sistar19
2. 'Bounce' by Cho Yong Pil
3. 'My Love' by Lee Seung Chul
4. 'Shower Of Tears' by BAE CHI GI (Feat. Ailee)
5. 'Turtle' by Davichi
6. 'What's Your Name?' by 4Minute
7. 'Bom Bom Bom' by Roy Kim
8. 'Give It To Me' by SISTAR
9. 'Bar Bar Bar' by Crayon Pop
10. 'Monodrama' by Huh Gak (With Yoo Seung Woo)
11. 'Tears' by Leessang (Feat. Eugene of The SEEYA)
12. 'NoNoNo' by Apink
14. 'Touch Love' by Yoon Mi Rae (T)
15. 'Winter Love' by The One
16. 'Gentleman' by PSY
17. 'I'm Sorry' by CNBLUE
18. 'What's Wrong With My Age' by Oh Seung-Keun
19. 'GROWL' by EXO
20. 'I Got A Boy' by Girls' Generation
21. 'Cherry Blossom Ending' by Busker Busker
22. 'Crazy of You' by Hyorin
23. 'Hands Of The Clock' by Shinyoo
24. 'Snow Flower' by Gummy
25. 'Missing You Today' by Davichi
26. 'Crescendo' by Akdong Musician (AKMU)
27. 'All Right' by Lim Kim
28. 'First Marriage' by Jang Yoon Jeong
29. 'I Love You' by Akdong Musician (AKMU)
30. 'Return' by Lee Seung Gi
31. 'Story Of Someone I Know' by San E
32. 'Love Blossom' by K.Will
33. 'Yoo Hoo' by Secret
34. 'Rose' by LeeHi
35. 'And One' by Tae Yeon (of Girls' Generation)
36. 'Short Hair' by Huh Gak, Jung Eunji (Apink)
37. 'Don't Think You're Alone' by Kim Bo Kyung
38. 'Life As a Floating Weed' by Kim Yong Im
39. 'Don't You Know' by Davichi
40. '1440' by Huh Gak
41. 'Gangbuk Fancy Pants' by Jung Hyung Don
42. 'Stupid In Love' by Soyou & Mad Clown
43. 'Shadow' by BEAST
44. 'Crooked' by G-Dragon
45. 'BAAAM' by Dynamic Duo (Feat. Muzie Of UV)
46. 'Rum Pum Pum Pum' by f(x)
47. 'Bad Girls' by Lee Hyo Ri
48. 'Only You' by 4Men
49. 'Miss Korea' by Lee Hyo Ri
50. 'Be Warmed' by Davichi (Feat. Verbal Jint)
51. 'FALLING IN LOVE' by 2NE1
52. 'I Hate It' by Baek Ji Young
53. 'One Spring Day' by 2AM
54. 'To You' by Sung Si-Kyung
55. 'Love, At First' by Busker Busker
56. 'Bad Girl' by Bumkey (Feat. E-sens Of Supreme Team)
57. 'Expectation' by Girl's Day
58. 'Dream Girl' by SHINee
59. 'Miss Right' by Teen Top
60. 'Hello It's Me' by 4Men
61. 'Attraction' by Bumkey (Feat. Dynamic Duo)
62. 'Best Wishes To You' by The One
63. 'Propose Song' by 4Men
64. 'Why Did You Come Just Now' by Jung Yup
65. 'Tonight' by Lyn (Feat. Baechigi)
66. 'Goodbye To Romance' by Sunny Hill
67. 'Hello' by Cho Yong Pil (Feat. VerbalJint)
68. 'Black' by G-Dragon (Feat. Jennie Kim Of YG New Artist)
69. 'I'm in Love' by 2BiC
70. 'Be OK' by Yu Seong Eun (Feat. Baechigi)
71. 'Day And Night' by Gummy
72. 'Caffeine' by Yang Yo Seob (Beast) (Feat. Junhyung of B2ST)
73. 'Special Girl' by Infinite H Featuring Bumkey
74. 'Don't Forget Me' by Suzy
75. 'Foreigner's Confessions' by Akdong Musician (AKMU)
76. 'Dancing Queen' by Girls' Generation
77. 'Good Start' by Verbal Jint (Feat. Kang Min Hee Of Miss $)
78. 'Break Up Dinner' by San E (Feat. Sanchez of Phantom)
79. 'It's Over' by LeeHi
80. 'Female President' by Girl's Day
81. 'The Red Shoes' by IU
82. 'The Way You Make Me Melt' by SISTAR (Feat. Geeks)
83. 'Man In Love' by INFINITE
84. '24 Hours' by SUNMI
85. 'For The Last Time' by VIBE
86. 'What's Happening' by B1a4
87. 'Do You Love Me' by 2NE1
88. 'Officially Missing You, Too' by Geeks, SoYu
89. 'Bean Ice Flakes With Rice Cake' by Akdong Musician (AKMU)
90. 'The Letter' by Davichi
91. 'Who You?' by G-Dragon
92. 'Is It Ramyun' by Akdong Musician (AKMU)
93. 'Hush' by miss A
94. 'That You're Mine' by Huh Gak (Feat. Swings)
95. 'Cosmic Girl' by Kim Tae Woo
96. 'Will You Be Alright?' by BEAST
97. 'How About' by GEEKS (Feat. Hareem)
98. 'Destiny' by INFINITE
99. 'Is It Poppin?' by 4Minute
100. 'I Can't Live Because Of You' by Seo In Kuk (Feat. Verbal Jint)