Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- df1 = pd.DataFrame({'Well_n': ['A', 'B', 'C', 'D'],
- 'Qo_rate': [200, 150, 170, 0],
- 'year': [2001, 2002, 2003, 2004]})
- df2 = pd.DataFrame({'Well_n': ['A', 'C', 'B', 'D'],
- 'Well_ECL': ['P1', 'P3', 'P2', 'P4']})
- df1.set_index('Well_n',inplace=True)
- df2.set_index('Well_n',inplace=True)
- joined = df1.join(df2,on='Well_n')
- print(joined)
- joined.set_index('year')
- Qo_rate Well_ECL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement