'Trying to change column from object to to date time

I am trying to change a object column to a date time column.

However, every time I run the code below, I get an TypeError: "NATType" object is not callable.

I am assuming that this is due to the blanks in the column but I am not really sure how to resolve it. Removing the rows is not an option here because there are other columns to consider as well.

df['jahreskontakt'] = pd.to_datetime(df['jahreskontakt'], errors='ignore')

Does anybody have any advice? Thanks in advance.

Explanations:

df['jahreskontakt'] #column with yearly contacts by sales team

Values that can be found in the column:

  • 2014-07-01 00:00:00
  • 00:00:00
  • ""

Full error: Tried changing between error = coerce or ignore

TypeError                                 Traceback (most 

recent call last)
<ipython-input-122-9d57805d9290> in <module>()
----> 1 df['jahreskontakt'] = pd.to_datetime(df['jahreskontakt'], errors='coerce')

TypeError: 'NaTType' object is not callable


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source