File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5272,6 +5272,29 @@ DataFrameTest >> testSortDescendingByAll [
52725272 self assert: actual equals: expected
52735273]
52745274
5275+ { #category : #tests }
5276+ DataFrameTest >> testSortDescendingByRowNames [
5277+
5278+ | dataFrame expected sortedDF |
5279+ dataFrame := DataFrame withRows:
5280+ #( #( 'CD' 3 2 )
5281+ #( 'AC' 1 4 )
5282+ #( 'DB' 2 4 )
5283+ #( 'BA' 5 1 ) ).
5284+ dataFrame rowNames: #( 'CD' 'AC' 'DB' 'BA' ) .
5285+
5286+ expected := DataFrame withRows:
5287+ #( #( 'DB' 2 4 )
5288+ #( 'CD' 3 2 )
5289+ #( 'BA' 5 1 )
5290+ #( 'AC' 1 4 ) ).
5291+ expected rowNames: #( 'DB' 'CD' 'BA' 'AC' ) .
5292+
5293+ sortedDF := dataFrame sortDescendingByRowNames.
5294+
5295+ self assert: sortedDF equals: expected
5296+ ]
5297+
52755298{ #category : #tests }
52765299DataFrameTest >> testToColumnApplyElementwise [
52775300
Original file line number Diff line number Diff line change @@ -2516,6 +2516,13 @@ DataFrame >> sortDescendingByAll: arrayOfColumnNames [
25162516 ^ self
25172517]
25182518
2519+ { #category : #sorting }
2520+ DataFrame >> sortDescendingByRowNames [
2521+ " Sorts the rows of the data frame based on the row names in ascending order"
2522+
2523+ self sortByRowNamesUsing: [ :a :b | a >= b ]
2524+ ]
2525+
25192526{ #category : #statistics }
25202527DataFrame >> stdev [
25212528 " Standard deviation is a measure of how dispersed the data is in relation to the average"
You can’t perform that action at this time.
0 commit comments