title: Python: TypeError: Invalid comparison between dtype=datetime64[ns] and date
body: <p>For a current project, I am planning to filter a JSON file by timeranges by running several loops, each time with a slightly shifted range. The code below however yields the error <code>TypeError: Invalid comparison between dtype=datetime64[ns] and date</code> for line <code>after_start_date = df["Date"] &gt;= start_date</code>.</p>
  
  <p>I have already tried to modify the formatting of the dates both within the Python code as well as the corresponding JSON file. Is there any smart tweak to align the date types/formats?</p>
  
  <p>The JSON file has the following format:</p>
  
  <pre><code>[
  {"No":"121","Stock Symbol":"A","Date":"05/11/2017","Text Main":"Sample text"}
  ]
  </code></pre>
  
  <p>And the corresponding code looks like this:</p>
  
  <pre><code>import string
  import json
  
  import pandas as pd
  import datetime
  from dateutil.relativedelta import *
  
  
  # Loading and reading dataset
  file = open("Glassdoor_A.json", "r")
  data = json.load(file)
  df = pd.json_normalize(data)
  df['Date'] = pd.to_datetime(df['Date'])
  
  
  # Create an empty dictionary
  d = dict()
  
  # Filtering by date
  
  start_date = datetime.date.fromisoformat('2017-01-01')
  end_date = datetime.date.fromisoformat('2017-01-31')
  
  for i in df.iterrows():
      start_date += relativedelta(months=+3)
      end_date += relativedelta(months=+3)
  
      print(start_date)
      print(end_date)
  
      after_start_date = df["Date"] &gt;= start_date
      before_end_date = df["Date"] &lt;= end_date
  
      between_two_dates = after_start_date &amp; before_end_date
      filtered_dates = df.loc[between_two_dates]
  
      print(filtered_dates)
  </code></pre>