コード例 #1
0
ファイル: dbase.py プロジェクト: tkoyama010/SciPy-CookBook
    def to_recarray(self):
        """
		Transform the data dictionary to a recarray or a masked array if missing values
		are present. Based on input from Pierre GM.
		"""
        # First, create the descriptor:
        descr = [(k, self.data[k].dtype) for k in b.data.keys()]
        # Then, create an empty record array:
        ra = recarray((self.nobs, ), dtype=descr)
        # Then fill the recarray:
        [setattr(ra, n, v) for (n, v) in self.data.iteritems()]

        return ra
コード例 #2
0
ファイル: dbase.py プロジェクト: apetcho/SciPy-CookBook
	def to_recarray(self):
		"""
		Transform the data dictionary to a recarray or a masked array if missing values
		are present. Based on input from Pierre GM.
		"""
		# First, create the descriptor:
		descr = [(k,self.data[k].dtype) for k in b.data.keys()]
		# Then, create an empty record array:
		ra = recarray((self.nobs,), dtype=descr)
		# Then fill the recarray:
		[setattr(ra,n,v) for (n,v) in self.data.iteritems()]

		return ra