May-06-2022, 06:58 PM
Got it working.. thank you for the suggestion, i updated the code to this and produced the correct results in the updated/new csv file
# THIS OPENS THE NEWLY CLEAN DATA IN ORDER TO REMOVE OLD RECORDS df = pd.read_csv("Dates.txt", usecols=range(3), header=None, names=["Date", "Time", "Comment"]) # THIS CONVERTS THE DATE COLUMN INTO A DATETIME FORMAT df['DT'] = pd.to_datetime(df['Date'] + ' ' + df['Time']) # HERE YOU NEED TO PROVIDE THE DATE YOU WANT TO KEEP GOING FORWARD mask = (df['DT'] > '2022-04-28 7:06 AM') # THIS RETURNS ALL ROWS GREATER THAN THE DATE PROVIDED ABOVE ndf = df.loc[mask]