Skip to content
Advertisement

Manually entered dataframes which were merged: possibility to sort by date

The below two dataframes df1 and df2 have been manually entered into Python. Then the dataframes were merged into df3. How can I make sure that the final merged dataframe df3 is using the same descending (chronological) order (as for the initial dataframes df1 and df2)(as it is not a case by default)? Thanks in advance

JavaScript

PS this question is a followup question to: how to enter manually a Python dataframe with daily dates in a correct format

Advertisement

Answer

To arrange the merged dataframe in descending order, you can update the merge line with this

JavaScript

This will sort df3 in descending chronological order.

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