(cls, domain, n_rows=0, weights=False)
return self
Construct a new `Table` with the given number of rows for the given
        domain. The optional vector of weights is initialized to 1's.

        :param domain: domain for the `Table`
        :type domain: Orange.data.Domain
        :param n_rows: number of rows in the new table
        :type n_rows: int
        :param weights: indicates whether to construct a vector of weights
        :type weights: bool
        :return: a new table
        :rtype: Orange.data.Table
Construct a new `Table` with the given number of rows for the given
        domain. The optional vector of weights is initialized to 1's.
Construct a new Table with the given number of rows for the given domain . The optional vector of weights is initialized to 1 s .
def from_domain(cls, domain, n_rows=0, weights=False):
        """
        Construct a new `Table` with the given number of rows for the given
        domain. The optional vector of weights is initialized to 1's.

        :param domain: domain for the `Table`
        :type domain: Orange.data.Domain
        :param n_rows: number of rows in the new table
        :type n_rows: int
        :param weights: indicates whether to construct a vector of weights
        :type weights: bool
        :return: a new table
        :rtype: Orange.data.Table
        """
        self = cls()
        self.domain = domain
        self.n_rows = n_rows
        with self.unlocked():
            self.X = np.zeros((n_rows, len(domain.attributes)))
            if len(domain.class_vars) != 1:
                self.Y = np.zeros((n_rows, len(domain.class_vars)))
            else:
                self.Y = np.zeros(n_rows)
            if weights:
                self.W = np.ones(n_rows)
            else:
                self.W = np.empty((n_rows, 0))
            self.metas = np.empty((n_rows, len(self.domain.metas)), object)
            cls._init_ids(self)
            self.attributes = {}
        return self
def from_domain ( cls , domain , n_rows = 0 , weights = False ) : self = cls ( ) self . domain = domain self . n_rows = n_rows with self . unlocked ( ) : self . X = np . zeros ( ( n_rows , len ( domain . attributes ) ) ) if len ( domain . class_vars ) != 1 : self . Y = np . zeros ( ( n_rows , len ( domain . class_vars ) ) ) else : self . Y = np . zeros ( n_rows ) if weights : self . W = np . ones ( n_rows ) else : self . W = np . empty ( ( n_rows , 0 ) ) self . metas = np . empty ( ( n_rows , len ( self . domain . metas ) ) , object ) cls . _init_ids ( self ) self . attributes = { } return self