@@ -485,19 +485,22 @@ DataFrame >> asArrayOfRowsWithName [
485485
486486{ #category : #accessing }
487487DataFrame >> at: aNumber [
488-
488+ " Returns the row of a DataFrame at row index aNumber"
489+
489490 ^ self rowAt: aNumber
490491]
491492
492493{ #category : #accessing }
493494DataFrame >> at: rowNumber at: columnNumber [
494-
495+ " Returns the value whose row index is rowNumber and column index is columnNumber"
496+
495497 ^ contents at: rowNumber at: columnNumber
496498]
497499
498500{ #category : #accessing }
499501DataFrame >> at: rowNumber at: columnNumber put: value [
500-
502+ " Replaces the original value of a DataFrame at row index rowNumber and column index columnNumber with a given value"
503+
501504 contents at: rowNumber at: columnNumber put: value
502505]
503506
@@ -637,15 +640,17 @@ DataFrame >> column: columnName transform: aBlock ifAbsent: exceptionBlock [
637640
638641{ #category : #accessing }
639642DataFrame >> columnAt: aNumber [
640-
643+ " Returns the column of a DataFrame at column index aNumber"
644+
641645 ^ (DataSeries withKeys: self rowNames values: (contents columnAt: aNumber))
642646 name: (self columnNames at: aNumber);
643647 yourself
644648]
645649
646650{ #category : #accessing }
647651DataFrame >> columnAt: aNumber put: anArray [
648-
652+ " Replaces the column at column index aNumber with contents of the array anArray"
653+
649654 anArray size = self numberOfRows
650655 ifFalse: [ SizeMismatch signal ].
651656
@@ -662,13 +667,15 @@ DataFrame >> columnAt: aNumber transform: aBlock [
662667
663668{ #category : #accessing }
664669DataFrame >> columnNames [
665-
670+ " Returns the column names of a DataFrame"
671+
666672 ^ columnNames
667673]
668674
669675{ #category : #accessing }
670676DataFrame >> columnNames: aCollection [
671-
677+ " Sets the column names of a DataFrame with contents of the collection aCollection"
678+
672679 | type |
673680 aCollection size = self numberOfColumns
674681 ifFalse: [ SizeMismatch signal : ' Wrong number of column names' ].
@@ -695,7 +702,8 @@ DataFrame >> columns [
695702
696703{ #category : #accessing }
697704DataFrame >> columns: anArrayOfNames [
698-
705+ " Returns a collection of columns whose column names are present in the array anArrayOfNames"
706+
699707 | anArrayOfNumbers |
700708
701709 anArrayOfNumbers := anArrayOfNames
@@ -707,6 +715,7 @@ DataFrame >> columns: anArrayOfNames [
707715
708716{ #category : #accessing }
709717DataFrame >> columns: anArrayOfColumnNames put: anArrayOfArrays [
718+ " Replaces the columns whose column names are present in the array anArrayOfColumnNames with the contents of the array of arrays anArrayOfArrays"
710719
711720 anArrayOfArrays size = anArrayOfColumnNames size
712721 ifFalse: [ SizeMismatch signal ].
@@ -717,6 +726,7 @@ DataFrame >> columns: anArrayOfColumnNames put: anArrayOfArrays [
717726
718727{ #category : #accessing }
719728DataFrame >> columnsAt: anArrayOfNumbers [
729+ " Returns a collection of columns whose column indices are present in the array anArrayOfNumbers"
720730
721731 | newColumnNames |
722732
@@ -731,6 +741,7 @@ DataFrame >> columnsAt: anArrayOfNumbers [
731741
732742{ #category : #accessing }
733743DataFrame >> columnsAt: anArrayOfNumbers put: anArrayOfArrays [
744+ " Replaces the columns whose column indices are present in the array anArrayOfNumbers with the contents of the array of arrays anArrayOfArrays"
734745
735746 anArrayOfArrays size = anArrayOfNumbers size
736747 ifFalse: [ SizeMismatch signal ].
@@ -741,6 +752,7 @@ DataFrame >> columnsAt: anArrayOfNumbers put: anArrayOfArrays [
741752
742753{ #category : #accessing }
743754DataFrame >> columnsFrom: begin to: end [
755+ " Returns a collection of columns whose column indices are present between begin and end"
744756
745757 | array |
746758
@@ -753,6 +765,7 @@ DataFrame >> columnsFrom: begin to: end [
753765
754766{ #category : #accessing }
755767DataFrame >> columnsFrom: firstNumber to: secondNumber put: anArrayOfArrays [
768+ " Replaces the columns whose column indices are present between firstNumber and secondNumber with the contents of the array of arrays anArrayOfArrays"
756769
757770 | interval |
758771
@@ -827,6 +840,7 @@ DataFrame >> correlationMatrixUsing: aCorrelationCoefficient [
827840
828841{ #category : #accessing }
829842DataFrame >> crossTabulate: colName1 with: colName2 [
843+ " Returns the cross tabulation of a column named colName1 with the column named colName2 of the DataFrame"
830844
831845 | col1 col2 |
832846
@@ -866,7 +880,8 @@ DataFrame >> dataTypeOfColumnAt: aNumber put: aDataType [
866880
867881{ #category : #accessing }
868882DataFrame >> dataTypes [
869-
883+ " Returns the data types of each column"
884+
870885 ^ dataTypes
871886]
872887
@@ -884,7 +899,8 @@ DataFrame >> defaultHeadTailSize [
884899
885900{ #category : #accessing }
886901DataFrame >> dimensions [
887-
902+ " Returns the number of rows and number of columns in a DataFrame"
903+
888904 ^ (self numberOfRows) @ (self numberOfColumns)
889905]
890906
@@ -918,7 +934,8 @@ DataFrame >> findAllIndicesOf: anObject atColumn: columnName [
918934
919935{ #category : #accessing }
920936DataFrame >> first [
921-
937+ " Returns the first row of the DataFrame"
938+
922939 ^ self at: 1
923940]
924941
@@ -1005,13 +1022,15 @@ DataFrame >> hasNilsByColumn [
10051022
10061023{ #category : #accessing }
10071024DataFrame >> head [
1008-
1025+ " Returns the first 5 rows of the DataFrame"
1026+
10091027 ^ self head: self defaultHeadTailSize
10101028]
10111029
10121030{ #category : #accessing }
10131031DataFrame >> head: aNumber [
1014-
1032+ " Returns the first aNumber rows of a DataFrame"
1033+
10151034 ^ self rowsAt: (1 to: (self numberOfRows min: aNumber))
10161035]
10171036
@@ -1330,7 +1349,8 @@ DataFrame >> normalized [
13301349
13311350{ #category : #accessing }
13321351DataFrame >> numberOfColumns [
1333-
1352+ " Returns the number of columns of a DataFrame"
1353+
13341354 ^ contents numberOfColumns
13351355]
13361356
@@ -1347,6 +1367,7 @@ DataFrame >> numberOfNils [
13471367
13481368{ #category : #accessing }
13491369DataFrame >> numberOfRows [
1370+ " Returns the number of rows of a DataFrame"
13501371
13511372 ^ contents numberOfRows
13521373]
@@ -1831,6 +1852,7 @@ DataFrame >> row: rowName transform: aBlock ifAbsent: exceptionBlock [
18311852
18321853{ #category : #accessing }
18331854DataFrame >> rowAt: aNumber [
1855+ " Returns the row of a DataFrame at row index aNumber"
18341856
18351857 | series |
18361858 series := (contents rowAt: aNumber) asDataSeries.
@@ -1841,6 +1863,7 @@ DataFrame >> rowAt: aNumber [
18411863
18421864{ #category : #accessing }
18431865DataFrame >> rowAt: aNumber put: anArray [
1866+ " Replaces the row at row index aNumber with contents of the array anArray"
18441867
18451868 anArray size = self numberOfColumns
18461869 ifFalse: [ SizeMismatch signal ].
@@ -1858,12 +1881,14 @@ DataFrame >> rowAt: aNumber transform: aBlock [
18581881
18591882{ #category : #accessing }
18601883DataFrame >> rowNames [
1861-
1884+ " Returns the row names of a DataFrame"
1885+
18621886 ^ rowNames
18631887]
18641888
18651889{ #category : #accessing }
18661890DataFrame >> rowNames: anArray [
1891+ " Sets the row names of a DataFrame with contents of the collection aCollection"
18671892
18681893 anArray size = self numberOfRows ifFalse: [ SizeMismatch signal : ' Wrong number of row names' ].
18691894
@@ -1874,6 +1899,7 @@ DataFrame >> rowNames: anArray [
18741899
18751900{ #category : #accessing }
18761901DataFrame >> rows: anArrayOfNames [
1902+ " Returns a collection of rows whose row names are present in the array anArrayOfNames"
18771903
18781904 | anArrayOfNumbers |
18791905
@@ -1886,6 +1912,7 @@ DataFrame >> rows: anArrayOfNames [
18861912
18871913{ #category : #accessing }
18881914DataFrame >> rows: anArrayOfRowNames put: anArrayOfArrays [
1915+ " Replaces the rows whose row names are present in the array anArrayOfRowNames with the contents of the array of arrays anArrayOfArrays"
18891916
18901917 anArrayOfArrays size = anArrayOfRowNames size
18911918 ifFalse: [ SizeMismatch signal ].
@@ -1896,6 +1923,7 @@ DataFrame >> rows: anArrayOfRowNames put: anArrayOfArrays [
18961923
18971924{ #category : #accessing }
18981925DataFrame >> rowsAt: anArrayOfNumbers [
1926+ " Returns a collection of rows whose row indices are present in the array anArrayOfNumbers"
18991927
19001928 | newRowNames |
19011929
@@ -1910,6 +1938,7 @@ DataFrame >> rowsAt: anArrayOfNumbers [
19101938
19111939{ #category : #accessing }
19121940DataFrame >> rowsAt: anArrayOfNumbers put: anArrayOfArrays [
1941+ " Replaces the rows whose row indices are present in the array anArrayOfNumbers with the contents of the array of arrays anArrayOfArrays"
19131942
19141943 anArrayOfArrays size = anArrayOfNumbers size
19151944 ifFalse: [ SizeMismatch signal ].
@@ -1920,12 +1949,14 @@ DataFrame >> rowsAt: anArrayOfNumbers put: anArrayOfArrays [
19201949
19211950{ #category : #accessing }
19221951DataFrame >> rowsFrom: begin to: end [
1952+ " Returns a collection of rows whose row indices are present between begin and end"
19231953
19241954 ^ self rowsAt: (begin to: end)
19251955]
19261956
19271957{ #category : #accessing }
19281958DataFrame >> rowsFrom: firstNumber to: secondNumber put: anArrayOfArrays [
1959+ " Replaces the rows whose row indices are present between firstNumber and secondNumber with the contents of the array of arrays anArrayOfArrays"
19291960
19301961 | interval |
19311962
@@ -1963,6 +1994,8 @@ DataFrame >> setDefaultRowColumnNames [
19631994
19641995{ #category : #accessing }
19651996DataFrame >> size [
1997+ " Returns the number of rows of a DataFrame"
1998+
19661999 ^ self numberOfRows
19672000]
19682001
@@ -2003,13 +2036,14 @@ DataFrame >> stdev [
20032036
20042037{ #category : #accessing }
20052038DataFrame >> tail [
2006-
2039+ " Returns the last 5 rows of a DataFrame"
2040+
20072041 ^ self tail: self defaultHeadTailSize
20082042]
20092043
20102044{ #category : #accessing }
20112045DataFrame >> tail: aNumber [
2012-
2046+ " Returns the last aNumber rows of aDataFrame "
20132047 | rows |
20142048 rows := self numberOfRows.
20152049
0 commit comments