Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy
- import matplotlib.pyplot as plt
- import pandas as pd
- #read data from pandas into a numpy array
- #assume this is our dataframe
- df = pd.DataFrame({'age': [ 3, 29, 30],
- 'height': [94, 170,200]})
- #reshape data
- m = df.values
- m = m[:,::-1].transpose()
- #plot the graph
- plt.scatter(m[0], m[1])
- plt.plot(m[0], m[1], '-')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement