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
- Dates read as plain textData Scientist
- Keeping the latest row per emailData Scientist
- Sorting by city then by salesData Scientist
- Getting the weekday from a date columnData Scientist