Skip to content

Commit fd67338

Browse files
Runnable examples for converting methods of DataFrame.
1 parent f0cc2a9 commit fd67338

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/DataFrame/DataFrame.class.st

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,23 +493,34 @@ DataFrame >> applyToAllColumns: aSymbol [
493493

494494
{ #category : #converting }
495495
DataFrame >> asArray [
496-
497496
"Converts DataFrame to the array of rows"
498497

498+
"(#(#(1 2) #(3 4)) asDataFrame asArray) >>> (#(#(1 2) #(3 4)))"
499+
500+
"(#(#(r1c1 r1c2) #(r2c1 r2c2)) asDataFrame asArray) >>> (#(#(r1c1 r1c2) #(r2c1 r2c2)))"
501+
499502
^ self asArrayOfRows
500503
]
501504

502505
{ #category : #converting }
503506
DataFrame >> asArrayOfColumns [
504507
"Converts DataFrame to the array of columns"
505508

506-
^ contents asArrayOfColumns.
509+
"(#(#(1 2) #(3 4)) asDataFrame asArrayOfColumns) >>> (#(#(1 3) #(2 4)))"
510+
511+
"(#(#(r1c1 r1c2) #(r2c1 r2c2)) asDataFrame asArrayOfColumns) >>> (#(#(r1c1 r2c1) #(r1c2 r2c2)))"
512+
513+
^ contents asArrayOfColumns
507514
]
508515

509516
{ #category : #converting }
510517
DataFrame >> asArrayOfRows [
511518
"Converts DataFrame to the array of rows"
512519

520+
"(#(#(1 2) #(3 4)) asDataFrame asArrayOfRows) >>> (#(#(1 2) #(3 4)))"
521+
522+
"(#(#(r1c1 r1c2) #(r2c1 r2c2)) asDataFrame asArrayOfRows) >>> (#(#(r1c1 r1c2) #(r2c1 r2c2)))"
523+
513524
^ contents asArrayOfRows
514525
]
515526

0 commit comments

Comments
 (0)