-2

by thought is using iterate the data frame column and check for required data in another column using condition checks. suggest is it correct or any other way.

Rakesh Bhagam
  • 117
  • 1
  • 2
  • 9
  • 1
    please refer to [MCVE](https://stackoverflow.com/help/mcve), for everyone's benefit and time not being wasted, could you post sample data and what you have tried so far. one sentence won't get us anywhere. thanks a lot. – stucash Dec 08 '17 at 13:00

2 Answers2

1

Merge, join and concatenate: look here

Joe
  • 12,057
  • 5
  • 39
  • 55
  • two data frames are didn't have any common column. but the first data frame column x data is matching with 2nd data frame of one column data but the data is in list of dictionary( one key of dict is matching with one column of 1st data frame) – Rakesh Bhagam Dec 08 '17 at 14:37
  • df1 = [{'name': 'Anastasia', 'score': 12.5}, {'name': 'Dima', 'score': 9}, {'name': 'Katherine', 'data': 16.5}] df2 = [{'test': 'ram', 'data': [{'xyz': '12.5', 'abc': 'ram'} ], {'test': 'jump', 'data': [{'xyz': '9', 'abc': 'jam'}], {'test': 'bheem', 'data': [{'xyz': '16.5', 'abc': 'pim'}]] in df1 column "Score: and df2 data[xyz] are common with this reference i want to merge my data frames : can any one help – Rakesh Bhagam Dec 08 '17 at 14:53
  • Then refactor second column in your dataframe into 2 separate columns. – jo9k Dec 08 '17 at 19:09
0

You should have a look at pandas merge function.

Guillaume Jacquenot
  • 11,217
  • 6
  • 43
  • 49