File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,10 +106,10 @@ DataFrameCsvReaderTest >> testReadFromString [
106106 actualDataFrame := DataFrameCsvReader new readFromString: TestCsvStrings commaCsvString.
107107
108108 self
109- assertCollection: actualDataFrame columns first
109+ assertCollection: actualDataFrame asArrayOfColumns first
110110 hasSameElements: #('1:10 am' '1:30 am' '1:50 am' '2:10 am' '2:30 am') .
111111 self
112- assertCollection: actualDataFrame columns last
112+ assertCollection: actualDataFrame asArrayOfColumns last
113113 hasSameElements: #('rain' 'rain' 'snow' '-' 'rain')
114114]
115115
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ DataFrameTypeDetector >> detectColumnTypeAndConvert: anArray [
146146{ #category : #' public API' }
147147DataFrameTypeDetector >> detectTypesAndConvert: aDataFrame [
148148
149- aDataFrame columns with: aDataFrame columnNames do: [ :column :columnName |
149+ aDataFrame asArrayOfColumns with: aDataFrame columnNames do: [ :column :columnName |
150150 | thisColumnType |
151151 " Get the user given column type for this column name and if it wasn't
152152 given then use the default type detection"
Original file line number Diff line number Diff line change @@ -543,7 +543,7 @@ DataFrame >> average [
543543{ #category : #' data-types' }
544544DataFrame >> calculateDataTypes [
545545
546- self columns doWithIndex: [ :column :i | self dataTypes at: (self columnNames at: i) put: column calculateDataType ]
546+ self asArrayOfColumns doWithIndex: [ :column :i | self dataTypes at: (self columnNames at: i) put: column calculateDataType ]
547547]
548548
549549{ #category : #comparing }
@@ -1052,8 +1052,10 @@ DataFrame >> hasNils [
10521052 " Returns true if there is atleast one nil value in the data frame. Returns false if there are no nil values in the dataframe"
10531053
10541054 | arrayOfColumns |
1055- arrayOfColumns := self columns.
1056- arrayOfColumns collect: [ :column | column hasNil ifTrue: [ ^ true ] ].
1055+ arrayOfColumns := self asArrayOfColumns.
1056+ 1 to: self numberOfColumns do: [ :column |
1057+ 1 to: self numberOfRows do: [ :row |
1058+ ((arrayOfColumns at: column) at: row) ifNil: [ ^ true ] ] ].
10571059 ^ false
10581060]
10591061
@@ -1394,7 +1396,7 @@ DataFrame >> normalized [
13941396 ' DataFrame will remove the dependency over normalization in the next version. You can use pharo-ai/data-preprocessing project to normalize your DataFrame and even more!' .
13951397 normalizers := (1 to: self anyOne size) collect: [ :e | self class defaultNormalizerClass new ].
13961398
1397- normalizedColumns := self columns with: normalizers collect: [ :col :normalizer | col normalizedUsing: normalizer ].
1399+ normalizedColumns := self asArrayOfColumns with: normalizers collect: [ :col :normalizer | col normalizedUsing: normalizer ].
13981400
13991401 ^ self class withColumns: normalizedColumns columnNames: self columnNames
14001402]
You can’t perform that action at this time.
0 commit comments