def prosperity_index_hkm_number(self, year): """ .. note:: 获取港澳台景气指数(景气指数无国内外和港澳台区分,都为同一列数据) :return: 景气指数 """ df = self.__data['景气指数'] pi = ProsperityIndex(df, "景气指数") ll = pi.peek_average(year, ref_type="W", ref_label='起飞星期', req={"Y": [1]}) return '%.2f' % ll['Y'][0]
def foreign_springFestival_max(self): """ .. note:: 计算国外春节时期景气指数的峰值 :return: 峰值 """ df = self.__data['景气指数'] pi = ProsperityIndex(df, "景气指数") ll = pi.peak_max(self.maximum_Year(), ref_type="W", ref_label='起飞星期', req={"M": [2]}) return '%.2f' % abs(ll['M'][0])
def prosperity_index_domestic_yoy(self): """ .. note:: 计算国内景气指数同比增幅 :return: 景气指数同比增幅 """ df = self.__data['景气指数'] pi = ProsperityIndex(df, "景气指数") ll = pi.yoy(self.maximum_Year(), ref_type="W", ref_label='起飞星期', req={"Y": [1]}) return '%.2f' % abs(ll['Y'][0])
def hkm_prosperity_index_yoy_compare(self): """ .. note:: 计算港澳台景气指数同比增幅的比较 :return: 差值 """ df = self.__data['景气指数'] pi = ProsperityIndex(df, "景气指数") ll = pi.yoy(self.maximum_Year() - 1, ref_type="W", ref_label='起飞星期', req={"Y": [1]}) lll = pi.yoy(self.maximum_Year(), ref_type="W", ref_label='起飞星期', req={"Y": [1]}) difference = lll['Y'][0] - ll['Y'][0] result = '%.2f' % abs(difference) return result
def domestic_prosperity_index_yoy(self): """ .. note:: 计算国内景气指数同比增幅的比较 :return: 比较 """ df = self.__data['景气指数'] pi = ProsperityIndex(df, "景气指数") ll = pi.yoy(self.maximum_Year() - 1, ref_type="W", ref_label='起飞星期', req={"Y": [1]}) lll = pi.yoy(self.maximum_Year(), ref_type="W", ref_label='起飞星期', req={"Y": [1]}) difference = lll['Y'][0] - ll['Y'][0] result = self.increase(difference) return result
def prosperity_index_compare_hmk(self): """ .. note:: 比较今明两年港澳台景气指数的差值 :return: 差值 """ df = self.__data['景气指数'] pi = ProsperityIndex(df, "景气指数") ll = pi.peek_average(self.maximum_Year(), ref_type="W", ref_label='起飞星期', req={"Y": [1]}) lll = pi.peek_average(self.maximum_Year() - 1, ref_type="W", ref_label='起飞星期', req={"Y": [1]}) difference = ll['Y'][0] - lll['Y'][0] result = self.increase(difference) return result