pythonpandascsvdatetime64csvreader

Fetching particular rows of a csv file where date matches as entered by user?


enter image description herei have a csv file like

Slot                   object
Name                   object
Plate                  object
Date_of_reg    datetime64[ns]
dtype: object

I was working on a parking program that can give person data based on given date I took date from user as shown below:

inputDate =input("Enter the date in format 'dd-mm-yy':")
y=datetime.datetime.strptime(inputDate,'%d-%m-%Y')
c=np.datetime64(y)

now if i am trying to read and print data from my csv file i get empty columns even though i have date

with open('parking.csv', mode='r') as park:
    park_reader =csv.DictReader(park)
    for row in park_reader:

                    


                     //some code that didn't work\\

I dunno what to do next any help would be hugely appreciated :) remember i only want to print rows where the input date matches


Solution

  • The empty database was being created as np.datetime64 is no longer comparable to datetime.datetime so that waa the problem