Hi,
I am currently reading data from a .dat file as CSV.
With the script below i manage to get data from the source, but i cant get data when i select to get data between 2 timestamps.
For example data between 2020-01-20 12:00:00 and 2020-01-25 12:15:00
With the script below i get the whole datarange from the source, see second field showing the output from the script.
Maybe someone have a hint on how to accomplish that?
Thanks.
I am currently reading data from a .dat file as CSV.
With the script below i manage to get data from the source, but i cant get data when i select to get data between 2 timestamps.
For example data between 2020-01-20 12:00:00 and 2020-01-25 12:15:00
With the script below i get the whole datarange from the source, see second field showing the output from the script.
Maybe someone have a hint on how to accomplish that?
Thanks.
import pandas as pd import numpy as np import datetime as dt import csv df = pd.read_csv("C:\\Users\\Makada\\Desktop\\CR1000_Table1 - kopie .dat", skiprows=1, index_col=['TIMESTAMP'], parse_dates=True, header=0, usecols=['TIMESTAMP','WS_kph_Max']) df['2020-01-20 20:59:00':'2020-01-22 21:01:00'] print(df)
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> =========== RESTART: C:\Users\Makada\Desktop\pppooooooooooooooooo.py =========== WS_kph_Max TIMESTAMP TS kilometers/hour NaN Max 2020-01-19 20:59:00 4.609 2020-01-19 21:00:00 4.294 2020-01-19 21:01:00 4.24 ... ... 2020-01-29 16:30:00 20.09 2020-01-29 16:31:00 30.92 2020-01-29 16:32:00 24.65 2020-01-29 16:33:00 21.34 2020-01-29 16:34:00 25.74 [14138 rows x 1 columns]