@@ -4016,60 +4016,60 @@ DataFrameTest >> testRemoveRowsAt [
40164016]
40174017
40184018{ #category : #removing }
4019- DataFrameTest >> testRemoveRowsOfColumnElementsSatisfingOnColumnAllTrue [
4019+ DataFrameTest >> testRemoveRowsWhereElementsInColumnAtSatisfy [
40204020
40214021 | expected aBlock |
4022+ df := DataFrame withRows:
4023+ #( #( 1 2 3 ) #( Dubai 4 5.0 ) #( nil 8.788 false ) ).
40224024
4023- expected := DataFrame withColumns: #() .
4024- aBlock := [ :rowElement | true ].
4025-
4026- self assert: (df removeRowsOfColumnElementsSatisfying: aBlock onColumn: 2 ) equals: expected
4027- ]
4025+ df rowNames: #( A B C ) .
4026+ df columnNames: #( X Y Z ) .
40284027
4029- { #category : #removing }
4030- DataFrameTest >> testRemoveRowsOfColumnElementsSatisfingOnColumnNamed [
4028+ expected := DataFrame withRows: #( #( Dubai 4 5.0 ) ).
40314029
4032- | expected aBlock |
4033- df := DataFrame withRows: #(
4034- (1 2 3)
4035- (Dubai 4 5.0 )
4036- (nil 8.788 false )).
4030+ expected rowNames: #( B ) .
4031+ expected columnNames: #( X Y Z ) .
40374032
4038- df rowNames: #(A B C) .
4039- df columnNames: #(X Y Z) .
4033+ aBlock := [ :rowElement | rowElement ~= 4 ].
40404034
4041- expected := DataFrame withRows: #(
4042- (Dubai 4 5.0) ).
4035+ self
4036+ assert: (df removeRowsWhereElementsInColumnAt: 2 satisfy: aBlock)
4037+ equals: expected
4038+ ]
40434039
4044- expected rowNames : #(B) .
4045- expected columnNames: #(X Y Z) .
4040+ { #category : #removing }
4041+ DataFrameTest >> testRemoveRowsWhereElementsInColumnAtSatisfyAllTrue [
40464042
4047- aBlock := [ :rowElement | rowElement ~= 4 ].
4043+ | expected aBlock |
4044+ expected := DataFrame withColumns: #( ) .
4045+ aBlock := [ :rowElement | true ].
40484046
4049- self assert: (df removeRowsOfColumnElementsSatisfing: aBlock onColumnNamed: #Y ) equals: expected
4047+ self
4048+ assert: (df removeRowsWhereElementsInColumnAt: 2 satisfy: aBlock)
4049+ equals: expected
40504050]
40514051
40524052{ #category : #removing }
4053- DataFrameTest >> testRemoveRowsOfColumnElementsSatisfyingOnColumn [
4053+ DataFrameTest >> testRemoveRowsWhereElementsInColumnNamedSatisfy [
40544054
40554055 | expected aBlock |
4056- df := DataFrame withRows: #(
4057- (1 2 3)
4058- (Dubai 4 5.0 )
4059- (nil 8.788 false )).
4056+ df := DataFrame withRows:
4057+ #( #( 1 2 3 ) #( Dubai 4 5.0 ) #( nil 8.788 false ) ).
40604058
4061- df rowNames: #(A B C) .
4062- df columnNames: #(X Y Z) .
4059+ df rowNames: #( A B C ) .
4060+ df columnNames: #( X Y Z ) .
40634061
4064- expected := DataFrame withRows: #(
4065- (Dubai 4 5.0) ).
4062+ expected := DataFrame withRows: #( #( Dubai 4 5.0 ) ).
40664063
4067- expected rowNames: #(B ) .
4068- expected columnNames: #(X Y Z) .
4064+ expected rowNames: #( B ) .
4065+ expected columnNames: #( X Y Z ) .
40694066
40704067 aBlock := [ :rowElement | rowElement ~= 4 ].
40714068
4072- self assert: (df removeRowsOfColumnElementsSatisfying: aBlock onColumn: 2 ) equals: expected
4069+ self
4070+ assert:
4071+ (df removeRowsWhereElementsInColumnNamed: #Y satisfy: aBlock)
4072+ equals: expected
40734073]
40744074
40754075{ #category : #removing }
0 commit comments