Skip to content

Commit f085adf

Browse files
authored
Merge pull request #282 from svenvc/master
Add DataFrame>>#summary
2 parents b0b0ed7 + f1127d7 commit f085adf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/DataFrame/DataFrame.class.st

+13
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,19 @@ DataFrame >> stdev [
25372537
^ self applyToAllColumns: #stdev
25382538
]
25392539

2540+
{ #category : #statistics }
2541+
DataFrame >> summary [
2542+
| summaryFrame |
2543+
summaryFrame := nil.
2544+
self columnNames do: [ :column |
2545+
((self dataTypeOfColumn: column) inheritsFrom: Number)
2546+
ifTrue: [
2547+
summaryFrame
2548+
ifNil: [ summaryFrame := (self column: column) summary asDataFrame ]
2549+
ifNotNil: [ summaryFrame addColumn: (self column: column) summary ] ] ].
2550+
^ summaryFrame
2551+
]
2552+
25402553
{ #category : #accessing }
25412554
DataFrame >> tail [
25422555
"Returns the last 5 rows of a DataFrame"

0 commit comments

Comments
 (0)