pastebin

Paste Search Dynamic
Recent pastes
dataframe
  1. from sklearn import datasets
  2. import pandas as pd
  3.  
  4. # load iris dataset
  5. iris = datasets.load_iris()
  6. # Since this is a bunch, create a dataframe
  7. df=pd.DataFrame(iris.data)
  8. print(df.columns)
  9. df['class']=iris.target
  10.  
  11. df.columns=['sepal.length', 'sepal.width', 'petal_len', 'petal_wid', 'class']
  12. df.dropna(how="all", inplace=true) # remove any empty lines
  13. print(df.head())
  14. import numpy as np
  15. import matplotlib. pyplot as plt
  16. from scipy. stats import norm
  17. x_axis=np.arange(-20,20,0.01)
  18. mean=df["sepal.length"].mean()
  19. sd=df.loc[:,"sepal.width"].std()
  20. plt. plot(x_axis,norm.pdf(x_axis,mean,sd))
  21. plt. show()
Parsed in 0.014 seconds