root_hist_filler.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Eskapade 作者: KaveIO 项目源码 文件源码
def _dtype(self, c):
        n = ':'.join(c)
        if n in self.var_dtype:
            return self.var_dtype[n]
        # ranking in order is: float, int, short, char
        elif any(self.var_dtype[col] == np.dtype(float) for col in c if col in self.var_dtype):
            return np.dtype(float)
        elif any(self.var_dtype[col] == np.dtype(int) for col in c if col in self.var_dtype):
            return np.dtype(int)
        elif any(self.var_dtype[col] == np.datetime64 for col in c if col in self.var_dtype):
            return np.dtype(int)
        elif any(self.var_dtype[col] == np.dtype('short') for col in c if col in self.var_dtype):
            return np.dtype('short')
        elif any(self.var_dtype[col] == np.dtype('byte') for col in c if col in self.var_dtype):
            return np.dtype('byte')
        elif any(self.var_dtype[col] == np.dtype(bool) for col in c if col in self.var_dtype):
            return np.dtype(bool)
        # default is float
        return self._default_dtype
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号