Now let's create our first dataset object. Simple type the following at the command prompt
>>> ds = Dataset([[1,1,1],[2,2,2],[3,3,3]])
You now have an instance of a Dataset in the variable ds
. To check this, just type ds
at the command prompt. You should see the following printed out
>>> ds Dataset: None, 3 by 3
This tells you that the variable ds
is an instance of class Dataset, it has no name (name is equal to None
) and the size of the dataset is 3 rows by 3 columns. To view the data in the dataset, we use the getData() method. Try it now
>>> ds.getData() [[ 1., 1., 1.,] [ 2., 2., 2.,] [ 3., 3., 3.,]]
As you can see, this is the same data which we entered when constructing the object.