@@ -167,11 +167,11 @@ DataSeries >> atIndex: aNumber transform: aBlock [
167167 self at: key transform: aBlock
168168]
169169
170- { #category : #information }
170+ { #category : #statistics }
171171DataSeries >> average [
172- " We do not count the nils"
172+ " Returns the average without including nils"
173173
174- ^ ( self values reject: #isNil ) average
174+ ^ self removeNils values average
175175]
176176
177177{ #category : #' data-types' }
@@ -520,6 +520,27 @@ DataSeries >> makeNumerical [
520520 forcedIsNumerical := true
521521]
522522
523+ { #category : #statistics }
524+ DataSeries >> max [
525+ " Returns the maximum value of the dataseries without including nils"
526+
527+ ^ self removeNils values max
528+ ]
529+
530+ { #category : #statistics }
531+ DataSeries >> median [
532+ " Returns the median without including nils"
533+
534+ ^ self removeNils values median
535+ ]
536+
537+ { #category : #statistics }
538+ DataSeries >> min [
539+ " Returns the minimum value of the dataseries without including nils"
540+
541+ ^ self removeNils values min
542+ ]
543+
523544{ #category : #accessing }
524545DataSeries >> mode [
525546 " The mode of a set of values is the value that appears most often. "
@@ -757,6 +778,13 @@ DataSeries >> sortedDescending [
757778 ^ self sorted: [ :a :b | a > b ]
758779]
759780
781+ { #category : #statistics }
782+ DataSeries >> stdev [
783+ " Returns the standard deviation of the dataseries without including nils"
784+
785+ ^ self removeNils values stdev
786+ ]
787+
760788{ #category : #transformation }
761789DataSeries >> sum [
762790 " Return the sum of the values over the requested axis. Nil values are excluded."
0 commit comments