File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2841,18 +2841,17 @@ DataFrameTest >> testNumericalColumnNames [
28412841{ #category : #tests }
28422842DataFrameTest >> testNumericalColumns [
28432843
2844- | dataFrame expected |
2844+ | dataFrame expectedCollection |
28452845 dataFrame := DataFrame withRows:
28462846 #( #( Male 21 Argentina 94 ) #( Female 20 France 97 )
28472847 #( Female 22 Spain 95 ) #( Male 24 Portugal 99 ) ).
28482848 dataFrame columnNames: #( Gender Age Country Score ) .
28492849
2850- expected := DataFrame withRows:
2851- #( #( 21 94 ) #( 20 97 ) #( 22 95 ) #( 24 99 ) ).
2852-
2853- expected columnNames: #( Age Score ) .
2850+ expectedCollection := {
2851+ (dataFrame columnAt: 2 ).
2852+ (dataFrame columnAt: 4 ) } asArray.
28542853
2855- self assert: dataFrame numericalColumns equals: expected
2854+ self assert: dataFrame numericalColumns equals: expectedCollection
28562855]
28572856
28582857{ #category : #splitjoin }
Original file line number Diff line number Diff line change @@ -1439,7 +1439,8 @@ DataFrame >> numericalColumnNames [
14391439DataFrame >> numericalColumns [
14401440 " Returns all numerical columns of the dataframe"
14411441
1442- ^ self columns: self numericalColumnNames
1442+ ^ self columns select: [ :column |
1443+ (self dataTypes at: column name) includesBehavior: Number ]
14431444]
14441445
14451446{ #category : #splitjoin }
You can’t perform that action at this time.
0 commit comments