Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import pandas as pd
- import matplotlib
- import matplotlib.pyplot as plt
- %matplotlib inline
- # end date
- end_date = dt.datetime(2018, 1, 1)
- # start date
- start_date = end_date - timedelta(days = 19)
- dates = pd.date_range(start_date, end_date)
- # Create Dataframe with random Int
- age = pd.DataFrame(np.random.randint(1,100,size=(20, 1)), columns=list('A'), index = dates)
- salary = np.log2(age['A'])
- salary = pd.DataFrame(salary, index = dates)
- df = pd.concat([salary['A'], age['A']], keys=['Salary', 'Age'], axis=1)
- ax = df.plot(title='Age and Salary', fontsize=12, color=['green', 'red'])
- ax.legend(loc='upper right')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement