Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import numpy as np
  2. import pandas as pd
  3. import matplotlib
  4. import matplotlib.pyplot as plt
  5. %matplotlib inline
  6.  
  7. # end date
  8. end_date = dt.datetime(2018, 1, 1)
  9. # start date
  10. start_date = end_date - timedelta(days = 19)
  11. dates = pd.date_range(start_date, end_date)
  12.  
  13. # Create Dataframe with random Int
  14. age = pd.DataFrame(np.random.randint(1,100,size=(20, 1)), columns=list('A'), index = dates)
  15. salary = np.log2(age['A'])
  16. salary = pd.DataFrame(salary, index = dates)
  17.  
  18. df = pd.concat([salary['A'], age['A']], keys=['Salary', 'Age'], axis=1)
  19. ax = df.plot(title='Age and Salary', fontsize=12, color=['green', 'red'])
  20. ax.legend(loc='upper right')
  21. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement