Feb-09-2022, 04:44 PM
Having a issue locating the proper format.
for k, v in ds.items(): v.label = k.title() print(v.dtype ) if v.dtype == 'object': v.format = '$CHAR20.' elif v.dtype == 'datetime64[ns]': v.format = '$DATETIME.' else: v.format = '10.2'
Error:493 2019-04-02 09:47:44.433262100
Name: dtsub, Length: 494, dtype: datetime64[ns]
object
int64
object
int64
object
object
int64
object
object
int64
object
int64
object
int64
object
object
int64
object
int64
object
int64
object
datetime64[ns]
Traceback (most recent call last):
File "c:\Users\Test Files\NewXport.py", line 98, in <module>
v.format = '$DATETIME.'
File "C:\Users\Local\Programs\Python\Python310\lib\site-packages\pandas\core\generic.py", line 5500, in __setattr__
return object.__setattr__(self, name, value)
File "C:\Users\Local\Programs\Python\Python310\lib\site-packages\xport\__init__.py", line 398, in format
self._format = Format.from_spec(value)
File "C:\Users\Local\Programs\Python\Python310\lib\site-packages\xport\__init__.py", line 264, in from_spec
return super().from_spec(spec=spec, justify=justify)
File "C:\Users\Local\Programs\Python\Python310\lib\site-packages\xport\__init__.py", line 162, in from_spec
raise ValueError(f'Invalid informat {spec}')
ValueError: Invalid informat $DATETIME.