Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add len of two DataFrames

I have two DataFrames df1 and df2.

I want to see what the length of both is added up.

But it seems I can't do len(df1) + len(df2).

Is there a quick way to do this (without joining them)?

like image 650
jeangelj Avatar asked Sep 06 '25 03:09

jeangelj


1 Answers

I think the fastest is sum lengths of indexes:

len(df1.index) + len(df2.index)

But is is same like your solution:

len(df1) + len(df2)
like image 98
jezrael Avatar answered Sep 07 '25 21:09

jezrael