Question
Option 2 : Only rows whose 'id' exists in both DataFrames / केवल वे पंक्तियाँ जिनका 'id' दोनों DataFrame में हो
Detailed Solution
सही उत्तर Only rows whose 'id' exists in both DataFrames / केवल वे पंक्तियाँ जिनका 'id' दोनों DataFrame में हो है।
Question:
In pd.merge(df1, df2, on='id', how='inner'), which rows appear in the result? / pd.merge(df1, df2, on='id', how='inner') में परिणाम में कौन-सी पंक्तियाँ आती हैं?
Correct Answer: Only rows whose 'id' exists in both DataFrames / केवल वे पंक्तियाँ जिनका 'id' दोनों DataFrame में हो
An inner merge keeps only the key values present in both DataFrames. Keeping all left rows with NaN fill is a left merge, not an inner merge. / इनर मर्ज केवल वे कुंजी-मान रखता है जो दोनों DataFrame में हों। बायीं सभी पंक्तियाँ NaN के साथ रखना लेफ्ट मर्ज है, इनर नहीं।