1

enter image description herei need to store a huge amount of data from influxdb to mf4 files to run it in famos, so i get the data from influxdb using query and I get it as dataframes and then I am trying to save it to the mf4 file but every time i am getting this error 'DatetimeTZDtype object has no attribute byteorder' I think the problem is from the index in the dataframes which is the timestamp returned from influxdb, i tried to convert it using many ways but i am still getting the same error, any help on how i should store these dataframes to mf4??

result=client.query(query,chucked=True)
mdf=MDF()
retconverted=result.convert_dtypes()
mdf.append(retconverted)
mdf.save('test.mf4', overwrite=True, times_as_date=True)
maha
  • 11
  • 2

2 Answers2

0

Try converting DateTime to UNIX timestamp

 import time
 import dateutil.parser
 import member.models import Member
 date_joined = member.date_joined
 dt = dateutil.parser.parse(date_joined)
 print int(time.mktime(dt.timetuple()))

If you can share how your date shows by printing it will help to understand the question more.

vuun0
  • 153
  • 1
  • 9
0

Try converting time to to_datetime

import pandas as pd
result['time'] = pd.to_datetime(result['time'])

#If you want you can change your time format like:
result['time'] = pd.to_datetime(df.time, errors='coerce').dt.strftime('%d.%m.%Y %H:%M:%S')