Skip to content
Snippets Groups Projects
Commit 6ee34afa authored by Christoph Olberding's avatar Christoph Olberding
Browse files

Upload New File

parent c956342e
Branches
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 26 11:19:34 2021
@author: Christoph
"""
import pandas as pd
import numpy as np
data = pd.read_csv('db_dump.csv',delimiter=';')
dumb=data.copy()
relevantData= pd.DataFrame.copy(data[['Streckenvorhersage.ZielortID','Streckenvorhersage.StartortID','Streckenvorhersage.Dauer']])
helpSeries= pd.DataFrame(np.zeros(relevantData.shape[0]))
#relevantData['day']=helpSeries
#relevantData['month']=helpSeries
#relevantData['year']=helpSeries
relevantData['time']=helpSeries
relevantData['day_index']=helpSeries
dates= data['Streckenvorhersage.Datum']
for d in range(dates.shape[0]):
toTest = dates[d]
hours = toTest[11:13]
minutes = toTest[14:16]
seconds = int(toTest[17:19]) + int(hours)*60*60 + int(minutes)*60
day = toTest[0:2]
month = toTest[3:5]
year = toTest[6:10]
day_index= int(day)+int(month)*31+int(year)*12
#relevantData.at[d,'month']= month
#relevantData.at[d,'day']=day
#relevantData.at[d,'year']=year
relevantData.at[d,'time']=seconds
relevantData.at[d,'day_index']=day_index
relevantData.to_csv('data.csv')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment