Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas query on datetime

from time import datetime

date_start = datetime(year_start, month_start, day_start)
date_end = datetime(year_end, month_end, day_end)

# df is your pandas dataframe
sel = df[(df['timestamp'] >= date_start) &
         (df['timestamp'] <= date_end)]

# tested with
# python 3.9.4
# pandas 1.3.2
Comment

PREVIOUS NEXT
Code Example
Python :: python run as service windows 
Python :: mad scipy 
Python :: TabError: inconsistent use of tabs and spaces in indentation 
Python :: python requests cookies 
Python :: python enumerate() function 
Python :: get classification report sklearn 
Python :: how to get discord username nextcord interactions 
Python :: python filter 
Python :: how to save bulk create in django 
Python :: pandas replace zero with blank 
Python :: remove outliers in dataframe 
Python :: how to import .csv file in python 
Python :: python - removeempy space in a cell 
Python :: simple colours python 
Python :: tkinter window background color 
Python :: pandas strips spaces in dataframe 
Python :: ffmpeg python cut video 
Python :: decrease hours in datetime python 
Python :: root number in python 
Python :: how to separate a string or int with comma in python 
Python :: how to get all folders on path in python 
Python :: django template for range 
Python :: How do you find the missing number in a given integer array of 1 to 100? 
Python :: discord.py get guild member list 
Python :: label encoding 
Python :: pandas append index ignore 
Python :: make lists for each 2 items in a list 
Python :: argumrnt with reverse django 
Python :: matplotlib plot 2d point 
Python :: memory used by python program 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =