I want to combine both CSV files based on Column1, also when combined each element of Column1 of both csv should match and also each row or Please suggest how to reorder Column1 according to another csv. In Jupyter Notebook Thank You!
There are many methods to connect two different kinds of datasets
- Python Pandas - Merging/Joining
- left − A DataFrame object.
- right − Another DataFrame object.
- on − Columns (names) to join on. ...
- left_on − Columns from the left DataFrame to use as keys. ...
- right_on − Columns from the right DataFrame to use as keys. ...
- left_index − If True, use the index (row labels) from the left DataFrame as its join key(s).
pd.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=True)
pd.merge( firstDF, secondDF ,on='Column1')
For More Resources: Padas Data Merging/Joining Resourse