Skip to content

Commit 757245e

Browse files
Added runnable examples for #categorical-numerical.
1 parent f609e4e commit 757245e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/DataFrame/DataSeries.class.st

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,25 @@ DataSeries >> interquartileRange [
561561
DataSeries >> isCategorical [
562562
"Returns true if atleast one value of the data series is non numerical and returns false otherwise"
563563

564+
"(#(a 1 2 3) asDataSeries isCategorical) >>> true"
565+
566+
"(#(0 1 2 3) asDataSeries isCategorical) >>> false"
567+
568+
"(#(a b c d) asDataSeries isCategorical) >>> true"
569+
564570
^ self isNumerical not
565571
]
566572

567573
{ #category : #'categorical-numerical' }
568574
DataSeries >> isNumerical [
569575
"Returns true if all values of the data series are numerical values and returns false otherwise"
570576

577+
"(#(a 1 2 3) asDataSeries isNumerical) >>> false"
578+
579+
"(#(0 1 2.2 3) asDataSeries isNumerical) >>> true"
580+
581+
"((#( I XIV VII XII ) collect: [ :each | each romanNumber ]) asDataSeries isNumerical) >>> true"
582+
571583
^ forcedIsNumerical ifNil: [
572584
(self removeDuplicates copyWithout: nil) allSatisfy: [ :each |
573585
each isNumber ] ]

0 commit comments

Comments
 (0)