'plt.hist range and value
Question: How many customers have spent between 132000 -136000 INR in the last 90 days?
Everything is alright. But I don't want to count manually which value(number of customers) in the first array is at this range (132000 -136000) in the second array. Like, insert the range here specified (132000 -136000 INR) and have the number of customers requested.
plt.figure(figsize=(40,20))
plt.hist(bank['spends_last90day'],bins=50)
Output:
(array([2.1964e+04, 1.4327e+04, 1.2155e+04, 7.8520e+03, 5.4390e+03,
4.1800e+03, 3.1860e+03, 2.5460e+03, 2.0510e+03, 1.6410e+03,
1.4010e+03, 1.1650e+03, 1.0500e+03, 8.9300e+02, 7.1500e+02,
6.4900e+02, 5.3300e+02, 4.7500e+02, 4.1200e+02, 3.8800e+02,
3.2900e+02, 2.7900e+02, 2.7400e+02, 2.3100e+02, 1.9600e+02,
2.9000e+02, 2.0400e+02, 1.6000e+02, 1.4600e+02, 1.3300e+02,
1.0100e+02, 1.0200e+02, 8.7000e+01, 6.8000e+01, 7.3000e+01,
6.0000e+01, 5.4000e+01, 5.4000e+01, 4.3000e+01, 4.1000e+01,
4.1000e+01, 2.0000e+01, 2.4000e+01, 2.2000e+01, 1.9000e+01,
1.7000e+01, 1.6000e+01, 1.5000e+01, 1.1000e+01, 1.3000e+01]),
array([ 0., 4000., 8000., 12000., 16000., 20000., 24000.,
28000., 32000., 36000., 40000., 44000., 48000., 52000.,
56000., 60000., 64000., 68000., 72000., 76000., 80000.,
84000., 88000., 92000., 96000., 100000., 104000., 108000.,
112000., 116000., 120000., 124000., 128000., *132000., 136000.*,
140000., 144000., 148000., 152000., 156000., 160000., 164000.,
168000., 172000., 176000., 180000., 184000., 188000., 192000.,
196000., 200000.]),
<BarContainer object of 50 artists>)
NB: still not able to upload images so be understandable, please.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
