Skip to content

Commit

Permalink
Merge pull request PolyMathOrg#281 from svenvc/master
Browse files Browse the repository at this point in the history
Change DataSeries>>#summary a bit
  • Loading branch information
jecisc authored Dec 7, 2023
2 parents b8d743e + 5068058 commit b0b0ed7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/DataFrame-Tests/DataSeriesTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2295,8 +2295,8 @@ DataSeriesTest >> testStatsSummary [
| expected actual |

expected := DataSeries
withKeys: #(Min '1st Qu.' Median Average '3rd Qu.' Max)
values: { 3 . 7 . 9 . (115 / 11) . 15 . 20 }
withKeys: #(Count Average Stdev Min '25%' '50%' '75%' Max)
values: { 11 . series values average . series values stdev . 3 . 7 . 9 . 15 . 20 }
name: series name.

actual := series summary.
Expand Down
14 changes: 9 additions & 5 deletions src/DataFrame/DataSeries.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1055,18 +1055,22 @@ DataSeries >> sum [

{ #category : #statistics }
DataSeries >> summary [
"A data series is returned which is a statistical summary of the data series. With keys as different statistical measures and values as the values returned when those statistical measures are applied on the data series."
"A data series is returned which is a statistical summary of the data series.
With keys as different statistical measures and values as the values returned
when those statistical measures are applied on the data series."

| summary |
summary := self species new.
summary name: self name.

summary
at: 'Min' put: self min;
at: '1st Qu.' put: self firstQuartile;
at: 'Median' put: self median;
at: 'Count' put: self size;
at: 'Average' put: self average;
at: '3rd Qu.' put: self thirdQuartile;
at: 'Stdev' put: self stdev;
at: 'Min' put: self min;
at: '25%' put: self firstQuartile;
at: '50%' put: self median;
at: '75%' put: self thirdQuartile;
at: 'Max' put: self max.

^ summary
Expand Down

0 comments on commit b0b0ed7

Please sign in to comment.