ValueError: Data type datetime64[ns] not currently understood. Please report an error to the developers. · Issue #12259 · pandas-dev/pandas (original) (raw)

I do what I am told to do ;-)

I have a big dataframe with the following columns

daily_news.dtypes
Out[11]: 
stock_ric                       object
obs_day                 datetime64[ns]
next_dayfirst           datetime64[ns]
sentimentmean                  float32
sentimentcount                   int64
companyNamefirst                object
timestamp_localfirst    datetime64[ns]
tickerfirst                     object
text                      object
dtype: object

and I try to save it using pd.to_stata

daily_news.to_stata( "mypath/data.dta",convert_dates= {'obs_day' : 'td'})

and I get

daily_news.to_stata( "python_news.dta",convert_dates= {'obs_day' : 'td'})
Traceback (most recent call last):

  File "<ipython-input-9-3d9426807f61>", line 1, in <module>
    daily_news.to_stata( "python_news.dta",convert_dates= {'obs_day' : 'td'})

  File "C:\Users\m1hxb02\AppData\Local\Continuum\Anaconda2\lib\site-packages\pandas\core\frame.py", line 1456, in to_stata
    write_index=write_index)

  File "C:\Users\m1hxb02\AppData\Local\Continuum\Anaconda2\lib\site-packages\pandas\io\stata.py", line 1859, in __init__
    self._prepare_pandas(data)

  File "C:\Users\m1hxb02\AppData\Local\Continuum\Anaconda2\lib\site-packages\pandas\io\stata.py", line 2043, in _prepare_pandas
    self.fmtlist.append(_dtype_to_default_stata_fmt(dtype, data[col]))

  File "C:\Users\m1hxb02\AppData\Local\Continuum\Anaconda2\lib\site-packages\pandas\io\stata.py", line 1802, in _dtype_to_default_stata_fmt
    "Please report an error to the developers." % dtype)

ValueError: Data type datetime64[ns] not currently understood. Please report an error to the developers.