I have two dataframes in pandas:
df1 can have 365 or 366 rows
df2 has 366 rows
If df1 and df2 have the same number of rows I want to output "same row size".
If, df1 and df2 don’t have the same sizes I want to delete row 59 at df2.
all because of leap year 🙂
>Solution :
Use:
if len(df1) != len(df2):
df2 = df2.drop(59)
Another idea is remove row with 29. Feb, how do it depends of data.