0 votes
1 view
in Data Science by (17.6k points)

I have a Series like this after doing groupby('name') and used mean() function on other column

name

383      3.000000

663      1.000000

726      1.000000

737      9.000000

833      8.166667

Could anyone please show me how to filter out the rows with 1.000000 mean values? Thank you and I greatly appreciate your help.

1 Answer

0 votes
by (32.5k points)

Use this below code to filter the series:

import pandas as pd

test = {

383:    3.000000,

663:    1.000000,

726:    1.000000,

737:    9.000000,

833:    8.166667

}

s = pd.Series(test)

s = s[s != 1]

Output:

383    3.000000

737    9.000000

833    8.166667

dtype: float64

Related questions

0 votes
1 answer
0 votes
3 answers
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...