I have two DataFrames that I append together ignoring the index so the rows from the appended DataFrame remain the same.
One DataFrame index goes from 0 to 200 and the second DataFrame index goes from 0 to 76
After appending them I try to sort it with a .sort_values then .sort_index because I want the same dates to be together but I also want the larger index to be above the smaller index with the same date as shown in the image below from my output. The red and green is correct but not the blue highlight
I think what is happening is that I have the process in reverse. I think I am sorting by index then by Date and the index order just lands randomly.
lookForwardData=lookForwardData.append(lookForwardDataShell,
ignore_index=True).sort_values("Date",ignore_index=False)
