May-22-2019, 08:17 PM
I have a file with many rows.
This is one of the lines:
2015-03-05 22:08:06.636451 2321
so in order to separate it, I wrote the following:
I get
How do I correct it?
This is one of the lines:
2015-03-05 22:08:06.636451 2321
so in order to separate it, I wrote the following:
from astral import Astral from scipy import * from pylab import* import numpy as np from numpy import array import matplotlib.pyplot as plt import datetime from datetime import timezone from datetime import timedelta import matplotlib.dates as dates import pandas as pd import pytz file=open('bird_jan25jan16.txt','r') #Turning datas in file into lists orig_date=[] orig_time=[] movements=[] for i in file: tempsplit=i.split(' ') orig_date.append(tempsplit[0]) orig_time.append(tempsplit[1]) movements.append(tempsplit[2])but when I print 'movements',
I get
Output:'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''
I am assuming that the splitting is wrong, but not sure.How do I correct it?