Advertisement
NubeColectiva

Test Pandas

Sep 7th, 2023
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. df['created_at'] = pd.to_datetime(df['created_at'])
  2.  
  3. hi = '2021-01-01 00:00:00.000000'
  4. hf = '2023-12-31 00:00:00.000000'
  5.  
  6. filtrar = (datos['created_at'] >= hi) & (datos['created_at'] <= hf)
  7.  
  8. resultado = datos.loc[filtrar]
  9. resultado
  10.  
  11. # Crear un Gráfico Básico (Plot) con los datos Filtrados
  12. import matplotlib.pyplot as plot
  13. plot.rcParams["figure.figsize"] = 20,11 # ancho: 20 , alto: 11
  14. resultado.plot(x="created_at", y="precio")
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement