Okay I'm stumped on this I've looked at the Pandas documentation but I can't figure out the right way to do it and I think I'm just making a mess. Basically I have data which are numpy arrays e.g.
data = numpy.loadtxt('foo.txt', dtype=str,delimiter=',')
gps_data = numpy.concatenate((data[0:len(data),0:2],data[0:len(data),3:5]),axis=1)
gps_time = data[0:len(data),2:3].astype(numpy.float)/1000
gps_data basically looks like this
array([['50.3482627', '-71.662499', '30', 'network'],
['50.3482588', '-71.6624934', '30', 'network'],
['50.34829', '-71.6625077', '30', 'network'],
...,
['20.3482488', '-78.66245463999999', '9', 'gps'],
['20.3482598', '-78.6625174', '30', 'network'],
['20.34824943', '-78.6624565', '10', 'gps']],
dtype='|S18')
and gps_time
array([[ 1.16242035e+09],
[ 1.26242036e+09],
[ 1.36242038e+09],
...,
[ 1.32330411e+09],
[ 1.16330413e+09],
[ 1.26330413e+09]])
What I'm trying to do is use DataFrame to bring another similar looking array called acc_data and combine it with gps_data and then go back through and fill in the different missing data times. E.g. this is what I've been trying
df1 = DataFrame(gps_data,index=gps_time,columns=['GPS'])
And it gives this error
ValueError: Shape of passed values is (4, 35047), indices imply (1, 35047)
Which I don't know how to handle, if I can find a way around that then I assume the next step df2 but for acc_data will work fine, and then I can do
p = Panel({'ACC': df1, 'GPS': df2})
Any help would be greatly appreciated been stumped on this for last few hours.