format number is not recognized in a cycle
Diego Avesani wrote:
> Dear Peter, Deal all,
> Trying different options, I manage this solution:
> mask = (df['datatime'] > str(start_date[ii])) & (df['datatime'] <=
> As you can notice, I have put str before start_date[ii]) and end_date[ii].
> What do you think?
Don't use your workaround unless you have ensured that
you get the correct result. Comparisons between arbitrary types are
dangerous in Python 2:
>>> "10" > 1
>>> "1" > 1
>>> "0" > 1
Perhaps you can find a better approach when you post your problem in a
forum dedicated to pandas.