DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


Python Program Examples

Example 1: The following Python example shows how to extract a particular column or row from the central data matrix "dl.dstore" and assign it to a vector. The vector x becomes a copy of column 13, the vector y becomes a copy of the row 4 (please note that array indexing in Python is 0-based, while in DataLab and in DLabPascal it is 1-based; thus the 13th column has the index 12 in Python):

import datalab as dl
from datalab import *
x = dl.dstore[:,12]    # extract column 13
y = dl.dstore[3,:]     # extract row 4
print (x)
print (y)

Example 2: The following Python example shows how to square the values of the first column of the data matrix:

import datalab as dl
from datalab import *
import numpy as np
dl.dstore[:,0] = np.square(dl.dstore[:,0])