Skip to content

8. Adding new rows and columns to DataFrame

Oleksandr Zaytsev edited this page Jan 10, 2018 · 1 revision

New rows and columns can be appended to the data frame using messages addRow:named and addColumn:named. Like in the case of DataSeries, you must provide a name for these new elements, since it can not continue the existing sequence of names.

df addRow: #('Lviv' 0.724 true) named: #D.
df addColumn: #(4 3 4) named: #Rating.

The same can be done using messages row:put: and column:put: with non-existing keys. DataFrame will append the new key and associate it with a given row or column

df at: #D put: #('Lviv' 0.724 true).
df at: #Rating put: #(4 3 4).

Tutorial

  1. Installation
  2. Creating DataSeries
Clone this wiki locally