I made the following dataframe from a .xlsx (I called it df)
candle_date low_price hight_price open_price close_price
0 2020-06-05 189,000.00 192,160.00 189,140.00 190,820.00
1 2020-06-05 189,000.00 190,940.00 189,000.00 189,120.00
2 2020-06-05 189,000.00 191,340.00 191,120.00 189,140.00
3 2020-06-05 190,220.00 191,700.00 190,860.00 191,100.00
4 2020-06-05 189,020.00 191,980.00 189,780.00 190,840.00
.. ... ... ... ... ...
95 2020-06-01 189,220.00 192,300.00 190,380.00 189,480.00
96 2020-06-01 188,000.00 191,220.00 188,000.00 190,360.00
97 2020-06-01 190,000.00 190,440.00 190,440.00 190,000.00
98 2020-06-01 190,440.00 190,780.00 190,460.00 190,440.00
99 2020-06-01 190,440.00 192,340.00 190,460.00 190,440.00
[100 rows x 5 columns]
plt.plot(df.iloc[:,3], color = "green")
But when graphing it does it from the highest date to the smallest date. How can I graph from lesser date to greater date?
Thanks in advance
Help from Thomas Breydo:
candle_date low_price hight_price open_price close_price
99 2020-06-01 190,440.00 190,780.00 190,460.00 190,440.00
86 2020-06-01 193,360.00 199,980.00 193,360.00 197,000.00
87 2020-06-01 191,060.00 195,420.00 191,100.00 193,340.00
88 2020-06-01 190,520.00 194,560.00 192,000.00 191,080.00
89 2020-06-01 188,360.00 193,600.00 192,000.00 192,020.00
.. ... ... ... ... ...
10 2020-06-05 189,000.00 194,200.00 189,760.00 189,220.00
11 2020-06-05 189,720.00 194,700.00 190,160.00 190,000.00
13 2020-06-05 190,020.00 193,080.00 190,040.00 190,040.00
7 2020-06-05 189,000.00 193,400.00 189,360.00 190,100.00
0 2020-06-05 189,000.00 191,000.00 191,000.00 189,000.00
[100 rows x 5 columns]
Edit: I need the data to be displayed in descending order, starting from row 99 to row 0: [99,98,97,...,4,3,2,1,0] to be able to graph correctly, it is a time graph.
Edit2: I've tried with:
df['candle_date'] = pd.to_datetime(df['candle_date'])
df = df.sort_values(by=['candle_date'])
candle_date low_price hight_price open_price close_price
99 2020-06-01 190,440.00 190,780.00 190,460.00 190,440.00
86 2020-06-01 193,360.00 199,980.00 193,360.00 197,000.00
87 2020-06-01 191,060.00 195,420.00 191,100.00 193,340.00
88 2020-06-01 190,520.00 194,560.00 192,000.00 191,080.00
89 2020-06-01 188,360.00 193,600.00 192,000.00 192,020.00
.. ... ... ... ... ...
10 2020-06-05 189,000.00 194,200.00 189,760.00 189,220.00
11 2020-06-05 189,720.00 194,700.00 190,160.00 190,000.00
13 2020-06-05 190,020.00 193,080.00 190,040.00 190,040.00
7 2020-06-05 189,000.00 193,400.00 189,360.00 190,100.00
0 2020-06-05 189,000.00 191,000.00 191,000.00 189,020.00
Same problem! :(
Edit3: I've solved it :) I don't know how to close this. Thanks to those who helped me.