python - How to sort only positive data in Pandas Series that contains negative and zeros -


i have pandas series have negative numbers, zeros , positives numbers. simplest way sort positive entries in descending order , return top 10 sorted result?

np.random.seed(123) s = pd.series(np.random.randint(-100,100,50)) s[s>0].sort_values(ascending=false).head(10) 

output:

25    95 32    89 39    80 33    76 15    74 47    68 20    64 44    55 17    53 34    35 dtype: int32 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -