I have the following DataFrame
The following statement should correctly filter the values between two dates.
# filtrando sólo del 2018-07-26 al 2018-08-02
df_selec['2018-07-26':'2018-08-02']
However, it returns me
Empty DataFrame
Columns: [cierres, Retornos, Retornos_acum, var_diaria, rend_diario, tend, prod_mov, pronostico, MA7, MA30, MA90, MA120]
Index: []
This another way to filter
# Seleccionar entre dos fechas del índice
df_selec[(df_selec['Date'] > '2018-07-30') & (df_selec['Date'] < '2018-08-02')]
I returned
KeyError: 'Date'
If we now do the same with a DataFrame obtained from Yahoo, the selection is made correctly
# Creando una serie de tiempo de las acciones de WFT desde yahoo finance
wft = web.DataReader("WFT", 'yahoo', '2000-1-1', '2018-8-30')
# filtrando sólo del 2016-02-04 al 2016-02-18
wft['2016-02-04':'2016-02-18']
Where is my mistake? What is it that I don't understand?
When the dates are the index of the df, we can select quotes in several ways. Option 1.
Option 1
Option 3.
Option 4.
Option 5.