Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

connect a mean value to histogram pandas

import numpy as np
import matplotlib.pyplot as plt
np.random.seed(6789)
x = np.random.gamma(4, 0.5, 1000)
result = plt.hist(x, bins=20, color='c', edgecolor='k', alpha=0.65)
plt.axvline(x.mean(), color='k', linestyle='dashed', linewidth=1)

min_ylim, max_ylim = plt.ylim()
plt.text(x.mean()*1.1, max_ylim*0.9, 'Mean: {:.2f}'.format(x.mean()))
Comment

PREVIOUS NEXT
Code Example
Python :: sort rows by values dataframe 
Python :: mediana python 
Python :: How to remove all characters after a specific character in python? 
Python :: how to add new column in csv file using pandas 
Python :: python not equal multiple values 
Python :: copy files to a directory using text file 
Python :: how to convert each string to a category or int in python dataframe 
Python :: feature to determine image too dark opencv 
Python :: python while true loop 
Python :: convert .py to .exe 
Python :: sorting a list of dictionaries 
Python :: django-sslserver 
Python :: use python dotenv 
Python :: django form list option 
Python :: how to find the speed of a python program 
Python :: howe to print all values and keysin d 
Python :: compare dates python 
Python :: pandas merge two columns from different dataframes 
Python :: how to get last n elements of a list in python 
Python :: access list items in python 
Python :: python import graphviz 
Python :: print colored text in python 
Python :: group by 2 unique attributes pandas 
Python :: python comment 
Python :: django createssuperuser 
Python :: python threading 
Python :: django url static 
Python :: display keys in a dictionary python 
Python :: from django.http import HttpResponse 
Python :: python dictionary to list 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =