Python Forum

Full Version: How can I count values between range dates ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

This is my first post in Forum Python, I am new at this so please bear with me.

I have this Code which I am trying to get results from. What I Need is to Count this specific value in this specific time of dates.

This is my Code :

df[(df['F_PRODDAT'] > '01.03.2018') & (df['F_PRODDAT'] <'01.03.2018')]['E_URSQSBEZ'].loc[df['E_URSQSBEZ'] == 'nicht befundet                                                                                      '].count()
As results I get zero but i am sure there are more then 300 values in this period of time.
I also tried to count all the values in this specific column during the range of date , this is the code :
df[(df['F_PRODDAT'] > '01.02.2018') & (df['F_PRODDAT'] <'01.04.2018')]['E_URSQSBEZ'].size()
and as a result I get really low number which is also not correct. when i use size() I get this error:

Error:
'int' object is not callable
Any help is much appriciated.
try using just .size instead of .size()
(Sep-03-2020, 11:53 AM)mlieqo Wrote: [ -> ]try using just .size instead of .size()

Thank you it helped.