Example #1
0
 def _get_page_data_confs(self, page_data_id):
     data = PageDataConfDao().query_by_page_data_id(page_data_id)
     if data:
         page_data_confs = []
         for row in data:
             page_data_confs.append(
                 PageDataConfEntity(row[0], row[1], row[2], row[3], row[4],
                                    row[5], row[6], row[7]))
         return page_data_confs
     else:
         Logging.warning('不存在该page_data_id:', page_data_id)
Example #2
0
 def df_effective_by_starting_position(self, starting_position,
                                       source_df: pd.DataFrame):
     """
     根据启始位置,获取有效数据
     :param starting_position: 起始位置
     :param source_df: 原始数据
     :return: DataFrame
     """
     get_data_flag = False
     data_cols = None  # 数据表title
     data_list = []  # 数据表内容
     for index, row in source_df.T.iteritems():
         values = row.values
         if get_data_flag:
             data_list.append(values)
         if values[0] == starting_position:
             get_data_flag = True
             data_cols = values
     if len(data_list) == 0:
         Logging.warning('无数据!')
         return True
     df = pd.DataFrame(data_list, columns=data_cols)
     return df