File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -459,6 +459,8 @@ DataFrame >> addRow: anArray named: aString atPosition: aNumber [
459459DataFrame >> applyElementwise: aBlock [
460460 " Applies a given block to all columns of a data frame"
461461
462+ " (#(#(1 2) #(3 4)) asDataFrame applyElementwise:[ :x | x - 1 ]) >>> (#(#(0 1) #(2 3)) asDataFrame)"
463+
462464 self toColumns: self columnNames applyElementwise: aBlock
463465]
464466
@@ -2389,6 +2391,8 @@ DataFrame >> toColumn: columnName applyElementwise: aBlock [
23892391DataFrame >> toColumnAt: columnNumber applyElementwise: aBlock [
23902392 " Applies a given block to a column whose column index is columnNumber of a data frame"
23912393
2394+ " (#(#(1 2) #(3 4)) asDataFrame toColumnAt: 1 applyElementwise:[ :x | x - 1 ]) >>> (#(#(0 2) #(2 4)) asDataFrame)"
2395+
23922396 | columnName |
23932397 columnName := self columnNames at: columnNumber.
23942398 ^ self toColumn: columnName applyElementwise: aBlock
@@ -2406,6 +2410,8 @@ DataFrame >> toColumns: arrayOfColumnNames applyElementwise: aBlock [
24062410DataFrame >> toColumnsAt: arrayOfColumnNumbers applyElementwise: aBlock [
24072411 " Applies a given block to columns whose indices are present in the array arrayOfColumnNumbers of a data frame"
24082412
2413+ " (#(#(1 2) #(3 4)) asDataFrame toColumnsAt: #(1 2) applyElementwise:[ :x | x - 1 ]) >>> (#(#(0 1) #(2 3)) asDataFrame)"
2414+
24092415 arrayOfColumnNumbers do: [ :each |
24102416 self toColumnAt: each applyElementwise: aBlock ]
24112417]
You can’t perform that action at this time.
0 commit comments