Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/DataFrame-Tests/DataFrameTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4927,6 +4927,18 @@ DataFrameTest >> testRowsFromToPut [
self assert: dataFrame equals: expected
]

{ #category : #tests }
DataFrameTest >> testRowsMethod [

| expectedCollection |
expectedCollection := {
(df rowAt: 1).
(df rowAt: 2).
(df rowAt: 3) } asArray.

self assert: df rows equals: expectedCollection
]

{ #category : #tests }
DataFrameTest >> testRowsPut [
| rowNames columnNames dataFrame newRows expected |
Expand Down
7 changes: 7 additions & 0 deletions src/DataFrame/DataFrame.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2052,6 +2052,13 @@ DataFrame >> rowNames: anArray [
self privateRowNames: anArray
]

{ #category : #accessing }
DataFrame >> rows [
"Returns a collection of all rows"

^ (1 to: self numberOfRows) collect: [ :j | self rowAt: j ]
]

{ #category : #accessing }
DataFrame >> rows: anArrayOfNames [
"Returns a collection of rows whose row names are present in the array anArrayOfNames"
Expand Down