Numeric Stream
interquartile_range()
: Calculate the interquartile range
interquartile_range()
: Calculate the interquartile rangeCalculates the interquartile range of a numerical Stream. Returns either int
or float
.
Stream.of([1, 2, 3, 4, 5, 7, 7, 8, 9, 9]) \
.interquartile_range() # Returns 5
first_quartile()
: Calculate the first quartile
first_quartile()
: Calculate the first quartileCalculates the first quartile of a numerical Stream. Returns either int
or float
.
Stream.of([1, 2, 3, 4, 5, 7, 7, 8, 9, 9]) \
.first_quartile() # Returns 3
mean()
: Calculate the mean
mean()
: Calculate the meanCalculates the mean of a numerical Stream. Returns either int
or float
.
Stream.of([1, 2, 3, 4, 5, 7, 7, 8, 9, 9]) \
.mean() # Returns 5.5
median()
: Calculate the median
median()
: Calculate the medianCalculates the median of a numerical Stream. Returns either int
or float
.
Stream.of([1, 2, 3, 4, 5, 7, 7, 8, 9, 9]) \
.median() # Returns 6.0
mode()
: Calculate the mode
mode()
: Calculate the modeCalculates the mode(s) (most frequently occurring element/elements) of a numerical Stream. Returns a list of either int
, float
or None
.
Stream.of([1, 2, 3, 4, 5, 7, 7, 8, 9, 9]) \
.mode() # Returns [7, 9]
range()
: Calculate the range
range()
: Calculate the rangeCalculates the range of a numerical Stream. Returns either int
or float
.
Stream.of([1, 2, 3, 4, 5, 7, 7, 8, 9, 9]) \
.range() # Returns 8
third_quartile()
: Calculate the range
third_quartile()
: Calculate the rangeCalculates the third quartile of a numerical Stream. Returns either int
or float
.
Stream.of([1, 2, 3, 4, 5, 7, 7, 8, 9, 9]) \
.third_quartile() # Returns 8
sum()
: Calculate the sum
sum()
: Calculate the sumCalculates the sum of all elements of a numerical Stream. Returns either int
or float
.
Stream.of([1, 2, 3]) \
.sum() # Returns 6
Last updated
Was this helpful?