def __process_ex_data(cls, original_pkl_path, root_path, pkl_file_name): data_frame = DataFrameFunction.get_data_frame_from_pkl(original_pkl_path) data_frame['company'] = cls.COMPANY_NAME # tohokuepcoは、日時で持っているのでTepcoに合わせて分割する。 DataFrameFunction.create_date_and_time_from_datetime(data_frame) # Date型に変換しておく。 data_frame['date_time'] = pandas.to_datetime(data_frame['date_time'], format='%Y/%m/%d %H:%M') # TOTAL算出 Total Supply Capacity data_frame['total_supply_capacity'] = DataFrameFunction.get_total_supply_capacity(data_frame) processed_pkl_path = FileFunction.get_processed_pkl_path(root_path, cls.COMPANY_NAME, pkl_file_name) FileFunction.create_pkl_file(processed_pkl_path, data_frame) return processed_pkl_path
def __process_ex_data(cls, original_pkl_path, root_path, pkl_file_name): data_frame = DataFrameFunction.get_data_frame_from_pkl(original_pkl_path) data_frame['company'] = cls.COMPANY_NAME # Kyudenは、日時で持っているのでTepcoに合わせて分割する。 DataFrameFunction.create_date_and_time_from_datetime(data_frame) # 2,500みたいなデータがあるので取り除く。 data_frame['demand'] = data_frame['demand'].astype(str).str.replace(',', '').astype(float) # 後続で計算できないのでfloatに変換している。 data_frame['nuclear'] = data_frame['nuclear'].astype(str).str.replace(',', '').astype(float) data_frame['thermal'] = data_frame['thermal'].astype(str).str.replace(',', '').astype(float) data_frame['solar_output_control'] = data_frame['solar_output_control'].astype(str).str.replace('None', '0') data_frame['solar_output_control'] = data_frame['solar_output_control'].str.replace('nan', '0') data_frame['solar_output_control'] = data_frame['solar_output_control'].str.replace(',', '') data_frame['solar_output_control'] = data_frame['solar_output_control'].astype(float) data_frame['pumping'] = data_frame['pumping'].astype(str).str.replace('None', '0') data_frame['pumping'] = data_frame['pumping'].str.replace('nan', '0') data_frame['pumping'] = data_frame['pumping'].str.replace(',', '') data_frame['pumping'] = data_frame['pumping'].astype(float) data_frame['interconnection'] = data_frame['interconnection'].astype(str).str.replace('None', '0') data_frame['interconnection'] = data_frame['interconnection'].str.replace('nan', '0') data_frame['interconnection'] = data_frame['interconnection'].str.replace(',', '') data_frame['interconnection'] = data_frame['interconnection'].astype(float) # Date型に変換しておく。 data_frame['date_time'] = pandas.to_datetime(data_frame['date_time'], format='%Y/%m/%d %H:%M') # TOTAL算出 Total Supply Capacity data_frame['total_supply_capacity'] = DataFrameFunction.get_total_supply_capacity(data_frame) processed_pkl_path = FileFunction.get_processed_pkl_path(root_path, cls.COMPANY_NAME, pkl_file_name) FileFunction.create_pkl_file(processed_pkl_path, data_frame) return processed_pkl_path