Skip to content
RED SAGSkills
medium10 pts · first answer countspandasjoins

Row count after a merge

How many rows does this print?

import pandas as pd

left = pd.DataFrame({'k': ['a', 'a', 'b'], 'x': [1, 2, 3]})
right = pd.DataFrame({'k': ['a', 'a', 'a', 'c'], 'y': [7, 8, 9, 10]})
print(len(left.merge(right, on='k')))
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions