Skip to content
Advertisement

reduce() to merge if there are blank DataFrame

I want to use reduce() function to merge data.

JavaScript

However, sometimes some dataframe df1 to df8 might be blank (but there is at least one dataframe not be blank).
And I do not want to detect which one.

For example, this time df1 to df7 are blank and only df8 is non-blank. Next time df1, df2, df5 are non-blank.

How should I do so?

Advertisement

Answer

You can rewrite your function to check for blank dataframes using the property DataFrame.empty:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement