Trying to write code that will do the following: Read a column from an sqlite DB and put into a dataframe1.
Have a gui where a user inserts two dates, start and end. I then turn that into a date_range column dataframe2
name = 'Bob'
startDate = pd.to_datetime(str('10/02/2019'))
endDate = pd.to_datetime(str('10/09/2019'))
d=pd.date_range(start=startDate, end=endDate)
d = pd.DataFrame({'Date': d, 'Name':[name]*len(d)})
df1 = pd.DataFrame(dd, columns =['Date'])
#print(df1)
query = "select Date from testtablee"
df = pd.read_sql_query(query, engine)
print (df)
df2 = pd.DataFrame(df, columns = ['Date'])
print (df2)
This is the part I'm stuck on:
Compare the users datframe2 to existing dates in dataframe1 from SQLite. Count duplicate dates and store in a variable for each duplicated date. I do not wish to delete or remove duplicated dates, just count them. Everything I have googled will delete the duplicates. Not store it in a variable. I have no idea where to start on this phase.