I am trying to generate synthetic data with with date & time range. How can I include the needed date-time section in the program mentioned below?
import random
import sys
import math
latitude = 0.794501
longitude = -0.752568
file_n = 'random_lat_lon.csv'
def generate_random_data(lat, lon, num_rows, file_name):
with open(file_name, 'w') as output:
for _ in xrange(num_rows):
hex1 = '%012x' % random.randrange(16**12)
flt = float(random.randint(0,100))
dec_lat = random.random()/100
dec_lon = random.random()/100
output.write('%s,%.1f,%.6f,%.6f \n' % (hex1.lower(), flt, lon+dec_lon, lat+dec_lat))
generate_random_data(latitude, longitude, 600, file_n)
Include two columns of Start_DateTime & End_DateTime
along other columns in the output.
Appreciate the help, Thank in advance.