Good day
I have a pandas dataframe with 3 columns. Column two is in date format yyyy-mm-dd but I would like to convert these to ticks. I would like to know the most efficient way to do this (i.e. I don't want to loop through each row).
My code is as follows:
#Example of getting ticks
import time; # This is required to include time module.
ticks = time.time()
print("Number of ticks since 12:00am, January 1, 1970:", ticks)
#Example of converting to ticks
import datetime
s = "01/12/2015"
time.mktime(datetime.datetime.strptime(s, "%d/%m/%Y").timetuple())
#My code
import numpy as np
import pandas as pd
path = "C:/Users/geoff/OneDrive - Noble Brothers Consult (Pty) Ltd/Clients/GrAM/Daily Price Data/"
filename = "SST_5_Sept_2016_formatted.csv"
full_path = path + filename
data = pd.read_csv(full_path)
#here i need to convert the column data['Date'] to ticks
I have uploaded a screenshot my datafile as well:
Screenshot of datafile:
Thanks very much for your help.