'Plot based on different date
i've written the following code that plots the relative bpm for the various hours contained in the csv given in input, for a given date.
dfMonday['date'] = pd.to_datetime(dfMonday['date'])
df_temp = dfMonday.loc[dfMonday['date'] == '2021/04/26']
bpmMon = df_temp.tempo
hMon = df_temp.time
x = '26/04/2021'
meanBpmMon = bpmMon .mean()
second = plt.figure(figsize=(10,5))
plt.title('HOURS - BPM (MONDAY- 26/04/2021)')
plt.scatter(hMon , bpmMon , c = bpmMon)
plt.xticks(rotation=45)
Within the CSV I have other dates, all different from each other, which refer to other days of listening to music. What I would like to do is create more charts based on the date which is contained in the csv. In detail: if I have other n dates I would like to output n graphs based on the date contained in the csv.
Csv file have the following structure:
artist_name;ms_played;track_name;...date;time;week_day
Taylor Swift;35260;Wildest Dreams;...;2021-01-25;07:55;0
Edward Sharpe & The Magnetic Zeros;...2021-01-25;15:34;0
Kanye West; 127964; ...; 2021-02-21;08:08;0
Billie Eilish; 125412; ...; 2021-15-2; 15:02; 0
......
As you can see from the date column, I have several dates inside the csv
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
