1

I am new to Python. I am working on pandas package to analyse the work load pattern. My dataframe contains two columns with start and end time of work. I would like to filter rows of dataframe between particular start time and end time. For e.g after 7:00:00 am and before 18:00:00 pm. I tried using the following :

(df['STime'] > '7:00:00') & (df['ETime'] < '18:00:00') 

But it returns False for all rows.

1 Answer 1

1

You are just comparing the values that's why you are getting only False values Use this expression with dataframe.

 df=df[(df['STime'] > '7:00:00') and (df['ETime'] < '18:00:00')]
Sign up to request clarification or add additional context in comments.

2 Comments

I do have another doubt. I have yearly data for labor hour. I want to do a plot of this value for the whole year weekday wise. I want to plot the yearly data for each week day i.e. monday , tuesday , wednesday etc. Also i have multiple labor hour values for each date in which case i need to sum them up and plot them.
I would suggest you to create a new question with sample of you data and code that you tried. That would help me to understand better.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.