I have 2 data frames.
The first one "named x"
has the following format:
ISBN Age Category Count
20 000649840X Middle Adult 6
21 000649840X Young Adult 16
Where The same ISBN have multiple rows with different categories.
The other dataframe "named y"
has the one row for each ISBN value. I want to create two column in the last dataframe one for each category count where the final result should look like:
ISBN Middle Adult Count Young Adult Count
I tried
y["Young Adult Count"] = x[(x['Age Category'] == 'Young Adult') & (y['ISBN] == x['ISBN])]['Count']
But it did not work