Skip to content
Snippets Groups Projects
Commit 5a73b984 authored by Jakub Szczegiecki's avatar Jakub Szczegiecki
Browse files

Added file timestamp.ipynb

parent eac1209d
Branches
No related merge requests found
%% Cell type:code id:39fc9501 tags:
``` python
import datetime
import numpy as np
import pandas as pd
# Plik potrzebuje ramki danych df wygenerowanej jako zapytanie SQL
timestamp1 = df["TIMESTAMP"].astype('datetime64[ns]')
hour = timestamp1.astype('datetime64[ns]').dt.hour.astype(int)
minute = timestamp1.astype('datetime64[ns]').dt.minute.astype(int)
second = timestamp1.astype('datetime64[ns]').dt.second.astype(int)
microsecond = timestamp1.astype('datetime64[ns]').dt.microsecond.astype(int)
millisecond = microsecond/1000+second*1000+minute*60000+hour*3600000
delta_ms = millisecond - millisecond[0]
delta_ms
timestamp = pd.DataFrame()
timestamp = pd.concat([timestamp1, hour, minute, second, microsecond, delta_ms], axis = 1)
timestamp.columns = ['timestamp', 'hour', 'minute', 'second', 'microsecond', 'delta_ms']
timestamp
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment