title: TypeError: '<=' not supported between instances of 'Timestamp' and 'str'
body: <p>I can compile it. However, when I input my date and time I get the error. Below is the code in question regarding this issue. error code: TypeError: '&lt;=' not supported between instances of 'Timestamp' and 'str'.</p>
  <pre><code>class evaluation():
  
      def __init__(self, data):
          self.data = data
          self.data['Date'] = pd.to_datetime(self.data['Date'])
  
      # Will receive 'actual' datetime from df, and user defined 'start' and 'stop' datetimes.
      def in_range(self, actual, start, stop):
          return start &lt;= actual &lt;= stop
  
      def evaluate(self):
          user_start = pd.to_datetime(input(&quot;Enter your start date (yyyy-mm-dd hour:min:second): &quot;))
          user_stop = pd.to_datetime(input(&quot;Enter your end date (yyyy-mm-dd hour:min:second): &quot;))
  
          # creates series of True or False selecting proper rows.
          print(self.data['Date'].dtype)
          mask = self.data['Date'].apply(self.in_range, args=(user_start, user_stop))
  
          # Do the groupby and sum on only those rows.
          montant_init = self.data.loc[mask].groupby(&quot;Initiateur&quot;)[&quot;Montant (centimes)&quot;].sum()
          print(montant_init)
  
  </code></pre>
  <p>traceback error:</p>
  <pre><code>
  Traceback (most recent call last):
   File &quot;C:\Users\DELL\PycharmProjects\vps_project\main.py&quot;, line 31, in &lt;module&gt;
     init_evalobj.evaluations()
   File &quot;C:\Users\DELL\PycharmProjects\vps_project\main.py&quot;, line 24, in evaluations
     self.evaluate()
   File &quot;C:\Users\DELL\PycharmProjects\vps_project\evaluation.py&quot;, line 20, in evaluate
     mask = self.data['Date'].apply(self.in_range, args=(user_start, user_stop))
   File &quot;C:\Users\DELL\PycharmProjects\vps_project\venv\lib\site-packages\pandas\core\series.py&quot;, line 4138, in apply
     mapped = lib.map_infer(values, f, convert=convert_dtype)
   File &quot;pandas\_libs\lib.pyx&quot;, line 2467, in pandas._libs.lib.map_infer
   File &quot;C:\Users\DELL\PycharmProjects\vps_project\venv\lib\site-packages\pandas\core\series.py&quot;, line 4123, in f
     return func(x, *args, **kwds)
   File &quot;C:\Users\DELL\PycharmProjects\vps_project\evaluation.py&quot;, line 13, in in_range
     return start &lt;= actual &lt;= stop
  TypeError: '&lt;=' not supported between instances of 'Timestamp' and 'str'
  
  Process finished with exit code 1
  </code></pre>
  <pre><code>
  output:
  Enter your start date (yyyy-mm-dd hour:min:second): 2021.06.06 11:00:00
  
  Enter your end date (yyyy-mm-dd hour:min:second): 2021.06.06 12:00:00
  
  object
  
  + traceback error
  </code></pre>
  <p>thanks</p>