This is a piece of my code, but i don't know how to get this array as new column Height to the original csv file in the format?
| Date | Level | Heigth |
|---|---|---|
| 01-01-2021 | 45 | 0 |
| 02-01-2021 | 43 | 0 |
| 03-01-2021 | 47 | 1 |
| 04-01-2021 | 46 | 0 |
| ..... |
import pandas as pd
from scipy.signal import find_peaks
import matplotlib.pyplot as plt
bestand = pd.read_csv('file.csv', skiprows=1, usecols=[0, 1] , names=['date', 'level'])
bestand = bestand['level']
indices = find_peaks(bestand, height= 37, threshold=None, distance=None)
height = indices[1]['peak_heights']
print(height)