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 # DateとTimeで分割されているので結合した項目を作る。 DataFrameFunction.generate_data_time_field(data_frame) data_frame.set_index('date_time') # 2,500みたいなデータがあるので取り除く。 data_frame['demand'] = data_frame['demand'].astype(str).str.replace( ',', '').astype(int) data_frame['total_supply_capacity'] = data_frame[ 'total_supply_capacity'].astype(str).str.replace(',', '').astype(int) # 後続で計算できないのでfloatに変換している。 data_frame['thermal'] = data_frame['thermal'].astype(str).str.replace( ',', '').astype(float) # 他の電力に合わせて万kwからMWhに揃える。 DataFrameFunction.to_mwh(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 # DateとTimeで分割されているので結合した項目を作る。 DataFrameFunction.generate_data_time_field(data_frame) data_frame.set_index('date_time') # TOTAL算出 Total Supply Capacity data_frame[ 'total_supply_capacity'] = DataFrameFunction.get_total_supply_capacity( data_frame) # 後続で計算できないのでfloatに変換している。 data_frame['solar_output_control'] = data_frame[ 'solar_output_control'].astype(str).str.replace(',', '') data_frame['solar_output_control'] = data_frame[ 'solar_output_control'].astype(str).str.replace('−', '0') data_frame['solar_output_control'] = data_frame[ 'solar_output_control'].astype(float) data_frame['wind_output_control'] = data_frame[ 'wind_output_control'].astype(str).str.replace(',', '') data_frame['wind_output_control'] = data_frame[ 'wind_output_control'].astype(str).str.replace('−', '0') data_frame['wind_output_control'] = data_frame[ 'wind_output_control'].astype(float) 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 # DateとTimeで分割されているので結合した項目を作る。 DataFrameFunction.generate_data_time_field(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 # 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 # DateとTimeで分割されているので結合した項目を作る。 DataFrameFunction.generate_data_time_field(data_frame) data_frame.set_index('date_time') # 沖縄にない電力項目は0で埋める。 data_frame['nuclear'] = 0 data_frame['geothermal'] = 0 data_frame['pumping'] = 0 data_frame['interconnection'] = 0 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 # DateとTimeで分割されているので結合した項目を作る。 DataFrameFunction.generate_data_time_field(data_frame) data_frame.set_index('date_time') # 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 # DateとTimeで分割されているので結合した項目を作る。 DataFrameFunction.generate_data_time_field(data_frame) data_frame.set_index('date_time') # 後続で計算できないのでfloatに変換している。 # 地熱がハイフンなので0扱いにする。 data_frame['geothermal'] = data_frame['geothermal'].astype( str).str.replace('-', '0').astype(float) # 他の電力に合わせて万kwからMWhに揃える。 DataFrameFunction.to_mwh(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