Copy-Paste Imputation (CPI) for Energy Time Series
This project provides a Python implementation of an imputation method for energy time series. The CPI method copies data blocks with similar characteristics and pastes them into gaps of the time series while preserving the total energy of each gap.
Cite this software
Description
This repository contains the Python implementation of the Copy-Paste Imputation (CPI) method presented in the following paper:
M. Weber, M. Turowski, H. K. Çakmak, R. Mikut, U. Kühnapfel and V. Hagenmeyer, 2021, "Data-Driven Copy-Paste Imputation for Energy Time Series," in IEEE Transactions on Smart Grid, 12, 6, pp. 5409–5419, doi: 10.1109/TSG.2021.3101831.
Installation
To install this project, perform the following steps:
- Clone the project
- Open a terminal of the virtual environment where you want to use the project
cdinto the cloned directorypip install .orpip install -e .to install the project editable.- Use
pip install -e .[dev]to install with development dependencies
- Use
Use
from cpiets.cpi import CopyPasteImputation
import pandas as pd
cpi = CopyPasteImputation()
data = pd.read_csv('data.csv')
cpi.fit(data)
result = cpi.impute()
Input Data Requirements
Example data:
| time | energy |
|---|---|
| 2012-01-02 00:15:00 | 11.60 |
| 2012-01-02 00:30:00 | 24.87 |
| 2012-01-02 00:45:00 | 37.31 |
The names of the columns are arbitrary.
Assumptions:
- There are no missing values (nan) at the start or end of the time series.
- A day starts with the first value after 0:00 (0:15 in the example above) and ends with 0:00.
- The time series starts at the beginning of a day and ends at the end of a day.
Supported time formats:
- %Y-%m-%d %H:%M:%S (2020-01-17 13:37:42)
- %d-%b-%Y %H:%M:%S (17-Jan-2020 13:37:42)
Example
In this repository, we included example data derived from the ElectricityLoadDiagrams20112014 data set.
To run the CPI method with simple test data, you can run the example
python example/simple_imputation.py
and play around with the parameters.
Funding
This project is supported by the Helmholtz Association under the Joint Initiative "Energy System 2050 - A Contribution of the Research Field Energy".
License
This code is licensed under the LGPL-3.0 License.
- LGPL-3.0-or-later
Participating organisations
Reference papers
Mentions
- 1.Author(s): Jorge A. Silva-Castro, Jorge Á. González-Ordiano, Milagros Santos-Moreno, Luis Cortés-Muñoz, Diego Márquez-EsquedaPublished in Lecture Notes in Computer Science, Advances in Soft Computing by Springer Nature Switzerland in 2025, page: 165-17610.1007/978-3-032-09044-7_12
- 2.Author(s): Marian Turowski, Oliver Neumann, Lisa Mannsperger, Kristof Kraus, Kira Layer, Ralf Mikut, Veit HagenmeyerPublished in Lecture Notes in Computer Science, Energy Informatics by Springer Nature Switzerland in 2023, page: 3-2910.1007/978-3-031-48649-4_1
- 1.Author(s): Matheus T. M. Barbosa, Eric B. C. Barros, Vinícius F. Mota, Dionisio Leite Filho, Damla Turgut, Maycon L. M. PeixotoPublished in GLOBECOM 2023 - 2023 IEEE Global Communications Conference by IEEE in 2023, page: 4632-463710.1109/globecom54140.2023.10437845
- 2.Author(s): Marian Turowski, Moritz Weber, Oliver Neumann, Benedikt Heidrich, Kaleb Phipps, Hüseyin K. Çakmak, Ralf Mikut, Veit HagenmeyerPublished in Proceedings of the Thirteenth ACM International Conference on Future Energy Systems by ACM in 2022, page: 471-48410.1145/3538637.3539760
- 3.Author(s): Huseyin K. Cakmak, Veit HagenmeyerPublished in 2022 Open Source Modelling and Simulation of Energy Systems (OSMSES) by IEEE in 2022, page: 1-610.1109/osmses54027.2022.9769145
- 4.Author(s): Liying Li, Peijin Cong, Junlong Zhou, Zonghua Gu, Keqin LiPublished in 2022 IEEE International Conferences on Internet of Things (iThings) and IEEE Green Computing & Communications (GreenCom) and IEEE Cyber, Physical & Social Computing (CPSCom) and IEEE Smart Data (SmartData) and IEEE Congress on Cybermatics (Cybermatics) by IEEE in 2022, page: 349-35610.1109/ithings-greencom-cpscom-smartdata-cybermatics55523.2022.00025
- 5.Author(s): Stefan Meisenbacher, Janik Pinter, Tim Martin, Veit Hagenmeyer, Ralf MikutPublished in Proceedings - 31. Workshop Computational Intelligence : Berlin, 25. - 26. November 2021 by KIT Scientific Publishing in 2021, page: 11-3510.58895/ksp/1000138532-2
- 1.Author(s): Chunyu Zhang, Xueqian Fu, Dawei Qiu, Hamed Badihi, Haitong GuPublished in Renewable Energy by Elsevier BV in 2026, page: 12457610.1016/j.renene.2025.124576
- 2.Author(s): Balázs András Tolnai, Zhipeng Ma, Bo Nørregaard Jørgensen, Zheng Grace MaPublished in Information by MDPI AG in 2025, page: 83610.3390/info16100836
- 3.Author(s): Hanjiang Dong, Jizhong Zhu, Chi-yung Chung, Zipeng Liang, Haosen Yang, Xiyu WenPublished in Scientific Data by Springer Science and Business Media LLC in 202510.1038/s41597-025-06010-8
- 4.Author(s): Matheus T.M. Barbosa, Eric B.C. Barros, Vinícius F.S. Mota, Dionisio M. Leite Filho, Leobino N. Sampaio, Bruno T. Kuehne, Bruno G. Batista, Damla Turgut, Maycon L.M. PeixotoPublished in Computer Networks by Elsevier BV in 2025, page: 11103110.1016/j.comnet.2024.111031
- 5.Author(s): Kasaraneni Purna Prakash, Yellapragada Venkata Pavan Kumar, Kongara Ravindranath, Gogulamudi Pradeep Reddy, Mohammad Amir, Baseem KhanPublished in Energy Exploration & Exploitation by SAGE Publications in 2024, page: 1432-144910.1177/01445987231221877
- 6.Author(s): Abdulkadir Gozuoglu, Okan Ozgonenel, Cenk GezeginPublished in Internet of Things by Elsevier BV in 2024, page: 10114810.1016/j.iot.2024.101148
- 7.Author(s): Danhua Liu, Dan Huang, Ximing Chen, Jian Dou, Li Tang, Zhiqiang ZhangPublished in Electronics by MDPI AG in 2024, page: 344610.3390/electronics13173446
- 8.Author(s): Christos Hadjichristofi, Spyridon Diochnos, Kyriakos Andresakis, Vassilios VescoukisPublished in Energies by MDPI AG in 2024, page: 547810.3390/en17215478
- 9.Author(s): Chang Li, Gina Brecher, Jovana Kovačević, Hüseyin K. Çakmak, Kevin Förderer, Jörg Matthes, Veit HagenmeyerPublished in Energy Informatics by Springer Science and Business Media LLC in 202410.1186/s42162-024-00353-z
- 10.Author(s): Yogitha Miriyala, Jai Govind SinghPublished in Energy Systems by Springer Science and Business Media LLC in 202410.1007/s12667-024-00658-8
- 11.Author(s): Deepak Adhikari, Wei Jiang, Jinyu Zhan, Maregu Assefa, Hadi A. Khorshidi, Uwe Aickelin, Danda B. RawatPublished in IEEE Internet of Things Journal by Institute of Electrical and Electronics Engineers (IEEE) in 2024, page: 3676-368910.1109/jiot.2023.3315137
- 12.Author(s): Dmitrii Vasenin, Marco Pasetti, Davide Astolfi, Nikita Savvin, Stefano Rinaldi, Alberto BerizziPublished in IEEE Access by Institute of Electrical and Electronics Engineers (IEEE) in 2024, page: 103520-10353610.1109/access.2024.3434652
- 13.Author(s): Chun Fu, Matias Quintana, Zoltan Nagy, Clayton MillerPublished in Applied Thermal Engineering by Elsevier BV in 2024, page: 12154510.1016/j.applthermaleng.2023.121545
- 14.Author(s): Yixiong Jia, Zhifeng Liang, Xuesong Huo, Wenjin Chen, Yun Chai, Ruoying YuPublished in Energy Reports by Elsevier BV in 2023, page: 2653-266410.1016/j.egyr.2023.01.079
- 15.Author(s): Jonas Fernando Schreiber, Airam Sausen, Mauricio De Campos, Paulo Sérgio Sausen, Marco Thomé Da Silva Ferreira FilhoPublished in IEEE Access by Institute of Electrical and Electronics Engineers (IEEE) in 2023, page: 31931-3194010.1109/access.2023.3262188
- 16.Author(s): S.Y. Teng, C. Cambier van Nooten, J.M. van Doorn, A. Ottenbros, M.A.J. Huijbregts, J.J. JansenPublished in Renewable and Sustainable Energy Reviews by Elsevier BV in 2023, page: 11366210.1016/j.rser.2023.113662
- 17.Author(s): Євген Холявка, Юлія ПарфененкоPublished in Computer systems and information technologies by Khmelnytskyi National University in 2023, page: 12-2210.31891/csit-2023-3-2
- 18.Author(s): Moses Amoasi Acquah, Yuwei Jin, Byeong-Chan Oh, Yeong-Geon Son, Sung-Yul KimPublished in IEEE Access by Institute of Electrical and Electronics Engineers (IEEE) in 2023, page: 5850-586310.1109/access.2023.3235724
- 19.Author(s): Markus Schaffer, Torben Tvedebrink, Anna Marszal-PomianowskaPublished in Scientific Data by Springer Science and Business Media LLC in 202210.1038/s41597-022-01502-3
- 20.Author(s): Sheng Liu, Di Wu, Hongfang Sun, Lanyong ZhangPublished in IEEE Sensors Journal by Institute of Electrical and Electronics Engineers (IEEE) in 2022, page: 13162-1317610.1109/jsen.2022.3177167
- 21.Author(s): Purna Prakash Kasaraneni, Yellapragada Venkata Pavan Kumar, Ganesh Lakshmana Kumar Moganti, Ramani KannanPublished in Sensors by MDPI AG in 2022, page: 932310.3390/s22239323
- 22.Author(s): Stefan Meisenbacher, Marian Turowski, Kaleb Phipps, Martin Rätz, Dirk Müller, Veit Hagenmeyer, Ralf MikutPublished in WIREs Data Mining and Knowledge Discovery by Wiley in 202210.1002/widm.1475
- 23.Author(s): Nguyen Duc Tuyen, Nguyen Trong Thanh, Vu Xuan Son Huu, Goro FujitaPublished in IET Renewable Power Generation by Institution of Engineering and Technology (IET) in 2022, page: 794-81310.1049/rpg2.12634
- 24.Published in IEEE Transactions on Smart Grid by Institute of Electrical and Electronics Engineers (IEEE) in 2021, page: 5483-557510.1109/tsg.2021.3137570
- 1.Author(s): Bruno Cortes, Luís Henrique Tenório Bandória, Walquiria Silva, Madson Cortes AlmeidaPublished by Elsevier BV in 202510.2139/ssrn.5122359
- 2.Author(s): Zengyao Tian, Wenchen Deng, Meng Liu, Li Lv, Zhikui ChenPublished in 202510.3390/su172310434
- 3.Author(s): Yan Xia, Hao Feng, Hongwei Sun, Junjie Wang, Qicong HuPublished in 202510.1145/3766671.3766749
- 4.Author(s): Anna Harman, Lukas Baur, Alexander SauerPublished by Applied Energy Innovation Institute (AEii) in 202410.46855/energy-proceedings-10980
- 5.Author(s): Chun Fu, Matias Quintana, Zoltan Nagy, Clayton MillerPublished by arXiv in 202310.48550/arxiv.2307.05926
- 6.Author(s): Benedikt Heidrich, Andreas Bartschat, Marian Turowski, Oliver Neumann, Kaleb Phipps, Stefan Meisenbacher, Kai Schmieder, Nicole Ludwig, Ralf Mikut, Veit HagenmeyerPublished by arXiv in 202110.48550/arxiv.2106.10157