Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import numpy
  2. import matplotlib.pyplot as plt
  3. import pandas as pd
  4.  
  5. #read data from pandas into a numpy array
  6. #assume this is our dataframe
  7. df = pd.DataFrame({'age': [ 3, 29, 30],
  8. 'height': [94, 170,200]})
  9.  
  10. #reshape data
  11. m = df.values
  12. m = m[:,::-1].transpose()
  13.  
  14. #plot the graph
  15. plt.scatter(m[0], m[1])
  16. plt.plot(m[0], m[1], '-')
  17. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement