Have 2 dataframes (foo and bar), but only want to export the dataframe with more rows to a csv. Unsure of how to populate a function that does this. My assumption is that it could look something like the below, but this only returns blank dataframes for x.
x = pd.DataFrame()
def longer():
if len(foo) > len(bar):
return foo
else:
return bar
x.apply(longer()).to_csv('x.csv')
Hoping this is a quick and easy answer--thanks so much!