Python - Select different row values from csv and combine them in new csv
问题 I have a csv file containing hourly data of wave conditions and data from measurements taken during certain times. I want to select wave conditions 6 hours before the measurement and the outcomes of the measurements. I want to export that to a new csv file for all the measurements. The code below selects the right rows for 1 measurement: df = pd.read_csv(csv, header=None, names=['survey', 'time', 'tides', 'mwp', 'swh', 'mwd', 'data1', 'data2', 'data3', 'data4', 'data5']) xp = [datetime