Histogram using python | Histogram tutorial | Histogram using matplotlib

  Рет қаралды 13,659

The AI & DS Channel

The AI & DS Channel

Күн бұрын

Пікірлер: 8
@rajalairenmayum326
@rajalairenmayum326 Жыл бұрын
Well explained
@TheAIandDSChannel
@TheAIandDSChannel Жыл бұрын
Thank you so much 😊
@sahilkhan2470
@sahilkhan2470 2 жыл бұрын
Great!
@TheAIandDSChannel
@TheAIandDSChannel 2 жыл бұрын
Thank you!
@dustbites3557
@dustbites3557 Жыл бұрын
Great video, but I have one question which is that how do I group multiple columns together and plot them as one histogram? Say if I want to plot the distribution of user stats by type, but my data has the columns: January Phone call, February Phone call, January Web visit, February Web visits, and I want the histogram to see the Phone calls as one group and Web visits as another group, how could I achieve that? Thank you!
@TheAIandDSChannel
@TheAIandDSChannel Жыл бұрын
Thank you for the comment. One approach would be to extract the columns which you want to group together, which in this case is a new column that has the aggregated values of both the columns of all the phone calls and website visits. And then using this data, plot a histogram. phone_call_cols = ['January Phone call', 'February Phone call'] web_visit_cols = ['January Web visit', 'February Web visit'] df['Phone calls'] = df[phone_call_cols].sum(axis=1) df['Web visits'] = df[web_visit_cols].sum(axis=1) plt.hist([df['Phone calls'], df['Web visits']], bins=10, label=['Phone calls', 'Web visits']) plt.xlabel('User Stats') plt.ylabel('Frequency') plt.legend() plt.show() hope that helps.
@dustbites3557
@dustbites3557 Жыл бұрын
@@TheAIandDSChannel I'll give this a try! Thank you very much!!
@TheAIandDSChannel
@TheAIandDSChannel Жыл бұрын
@@dustbites3557 Your welcome!
Bar Chart | Bar Graph using python | Bar chart tutorial
13:20
The AI & DS Channel
Рет қаралды 46 М.
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 68 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 37 МЛН
НИКИТА ПОДСТАВИЛ ДЖОНИ 😡
01:00
HOOOTDOGS
Рет қаралды 2,6 МЛН
Seaborn Python Tutorial - Part 1
24:22
Yiannis Pitsillides
Рет қаралды 49 М.
7 Python Data Visualization Libraries in 15 minutes
15:03
Rob Mulla
Рет қаралды 80 М.
Histogram | Part 1 | Matplotlib | Python Tutorials
20:35
Amulya's Academy
Рет қаралды 73 М.
Histogram | Part 2 | Matplotlib | Python Tutorials
11:38
Amulya's Academy
Рет қаралды 6 М.
5 Good Python Habits
17:35
Indently
Рет қаралды 571 М.
Seaborn Is The Easier Matplotlib
22:39
NeuralNine
Рет қаралды 174 М.
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 408 М.
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 68 МЛН