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')))Discussion 0
Join free to post in the discussion.
Related questions
- Customers with no ordersData Scientist
- Counting missing values in pandasData Scientist
- pandas mean with a missing valueData Scientist
- value_counts with normalizeData Scientist
- groupby with transformData Scientist
- groupby with a missing keyData Scientist
- Rolling mean at the edgesData Scientist
- LEFT JOIN that acts like INNER JOINData Scientist