medium10 pts · first answer countspandasdata-cleaning
Rows after a merge on duplicate keys
What does this pandas code print?
import pandas as pd
left = pd.DataFrame({'k': ['a', 'a', 'a'], 'x': [1, 2, 3]})
right = pd.DataFrame({'k': ['a', 'a'], 'y': [10, 20]})
print(len(left.merge(right, on='k')))Discussion 0
Join free to post in the discussion.
Related questions
- 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
- Lost leading zeros in IDsData Analyst
- Counting missing values in pandasData Analyst