enter image description here

Assume I have a following dataframe which has years of experience and salary.

I would like to create a new dataframe from the existing one, only including observations where salary is above 45000. I would like it to include both columns.


closed as off-topic by oW_, Mark.F, Sean Owen Feb 15 at 22:13

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about data science, within the scope defined in the help center." – oW_, Mark.F, Sean Owen
If this question can be reworded to fit the rules in the help center, please edit the question.


One way to separate these values out of your pd dataframe is to use Pandas indexing. There are many different routes that you could go, for this, I would recommend a boolean.

new_data = pd.data[data['salary'] >= 45000] 

Should separate your data out nicely.

You can read further about this here


Not the answer you're looking for? Browse other questions tagged or ask your own question.