0
I have two dataframes
, where the df1
contains the column Data
and Praca_ID
, where I need to look in the df2
, who owns DataInicial
DataFinal
Praca_ID
and Tarifa
(column to be returned.)
The example of jupyterlab in my github will detail well the problem:
Note line In [46]: which makes the code:
# Procurando tarifa equivalente ao tráfego da data a ser analisada:
dfTrafegoPracas['Tarifa'] = np.where((dfTarifas.Praca == dfTrafegoPracas.Praca)
& (dfTarifas.VigenciaInicial<=dfTrafegoPracas.Data) &
(dfTarifas.VigenciaFinal>=dfTrafegoPracas.Data), dfTarifas['Tarifa'], '')
I commented on this step because I can’t make it work..