>>> import heapq, random
>>> heapq.nlargest(3, (random.gauss(0, 1) for _ in xrange(100)))
[1.9730767232998481, 1.9326532289091407, 1.7762926716966254]
More Related Contents:
- How do you find min and max without using min and max function [duplicate]
- Get the row(s) which have the max value in groups using groupby
- How do I get indices of N maximum values in a NumPy array?
- Find the column name which has the maximum value for each row
- Finding max value in the second column of a nested list?
- How to find all positions of the maximum value in a list?
- Python: Maximum recursion depth exceeded
- How to get the index of a maximum element in a NumPy array along one axis
- Find maximum value of a column and return the corresponding row values using Pandas
- What is the maximum float in Python?
- Find the item with maximum occurrences in a list [duplicate]
- numpy max vs amax vs maximum
- How to find the min/max value of a common key in a list of dicts?
- How to limit a number to be within a specified range? (Python)
- 5 maximum values in a python dictionary
- Find min, max, and average of a list
- Find the greatest number in a list of numbers
- Set maximum value (upper bound) in pandas DataFrame
- How to make numpy.argmax return all occurrences of the maximum?
- Pandas max value index
- return max value from pandas dataframe as a whole, not based on column or rows
- Using Python’s max to return two equally large values
- Maximum and minimum value of C types integers from Python
- Max in a sliding window in NumPy array
- How do I find the maximum (larger, greater) of 2 numbers?
- Check if all values in list are greater than a certain number
- Python Pandas add column for row-wise max value of selected columns [duplicate]
- How to find the maximum number in a list using a loop?
- Find the greatest (largest, maximum) number in a list of numbers
- Get max value from row of a dataframe in python [duplicate]