@@ -4016,60 +4016,60 @@ DataFrameTest >> testRemoveRowsAt [
4016
4016
]
4017
4017
4018
4018
{ #category : #removing }
4019
- DataFrameTest >> testRemoveRowsOfColumnElementsSatisfingOnColumnAllTrue [
4019
+ DataFrameTest >> testRemoveRowsWhereElementsInColumnAtSatisfy [
4020
4020
4021
4021
| expected aBlock |
4022
+ df := DataFrame withRows:
4023
+ #( #( 1 2 3 ) #( Dubai 4 5.0 ) #( nil 8.788 false ) ).
4022
4024
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 ) .
4028
4027
4029
- { #category : #removing }
4030
- DataFrameTest >> testRemoveRowsOfColumnElementsSatisfingOnColumnNamed [
4028
+ expected := DataFrame withRows: #( #( Dubai 4 5.0 ) ).
4031
4029
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 ) .
4037
4032
4038
- df rowNames: #(A B C) .
4039
- df columnNames: #(X Y Z) .
4033
+ aBlock := [ :rowElement | rowElement ~= 4 ].
4040
4034
4041
- expected := DataFrame withRows: #(
4042
- (Dubai 4 5.0) ).
4035
+ self
4036
+ assert: (df removeRowsWhereElementsInColumnAt: 2 satisfy: aBlock)
4037
+ equals: expected
4038
+ ]
4043
4039
4044
- expected rowNames : #(B) .
4045
- expected columnNames: #(X Y Z) .
4040
+ { #category : #removing }
4041
+ DataFrameTest >> testRemoveRowsWhereElementsInColumnAtSatisfyAllTrue [
4046
4042
4047
- aBlock := [ :rowElement | rowElement ~= 4 ].
4043
+ | expected aBlock |
4044
+ expected := DataFrame withColumns: #( ) .
4045
+ aBlock := [ :rowElement | true ].
4048
4046
4049
- self assert: (df removeRowsOfColumnElementsSatisfing: aBlock onColumnNamed: #Y ) equals: expected
4047
+ self
4048
+ assert: (df removeRowsWhereElementsInColumnAt: 2 satisfy: aBlock)
4049
+ equals: expected
4050
4050
]
4051
4051
4052
4052
{ #category : #removing }
4053
- DataFrameTest >> testRemoveRowsOfColumnElementsSatisfyingOnColumn [
4053
+ DataFrameTest >> testRemoveRowsWhereElementsInColumnNamedSatisfy [
4054
4054
4055
4055
| 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 ) ).
4060
4058
4061
- df rowNames: #(A B C) .
4062
- df columnNames: #(X Y Z) .
4059
+ df rowNames: #( A B C ) .
4060
+ df columnNames: #( X Y Z ) .
4063
4061
4064
- expected := DataFrame withRows: #(
4065
- (Dubai 4 5.0) ).
4062
+ expected := DataFrame withRows: #( #( Dubai 4 5.0 ) ).
4066
4063
4067
- expected rowNames: #(B ) .
4068
- expected columnNames: #(X Y Z) .
4064
+ expected rowNames: #( B ) .
4065
+ expected columnNames: #( X Y Z ) .
4069
4066
4070
4067
aBlock := [ :rowElement | rowElement ~= 4 ].
4071
4068
4072
- self assert: (df removeRowsOfColumnElementsSatisfying: aBlock onColumn: 2 ) equals: expected
4069
+ self
4070
+ assert:
4071
+ (df removeRowsWhereElementsInColumnNamed: #Y satisfy: aBlock)
4072
+ equals: expected
4073
4073
]
4074
4074
4075
4075
{ #category : #removing }
0 commit comments