add some old code
This commit is contained in:
19
old/generate_electricity_price.py
Normal file
19
old/generate_electricity_price.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
|
||||
start_date = '2023-01-01'
|
||||
end_date = '2024-01-01'
|
||||
|
||||
# 创建时间索引
|
||||
time_index = pd.date_range(start=start_date, end=end_date, freq='15min')
|
||||
|
||||
# 生成电价数据,假设电价在0.28到0.32欧元/kWh之间波动
|
||||
price_data = np.random.uniform(0.28, 0.32, len(time_index))
|
||||
|
||||
# 创建DataFrame
|
||||
price_df = pd.DataFrame(data={'Time': time_index, 'ElectricityPrice': price_data})
|
||||
|
||||
# 保存到CSV文件
|
||||
price_df.to_csv('electricity_price_data.csv', index=False)
|
||||
|
||||
print("Electricity price data generated and saved.")
|
Reference in New Issue
Block a user