Question: Why the result below is True? The date objects have different types, how is this comparison done?

```py
import pandas as pd
import datetime

```

```py
df = pd.DataFrame({
    'year': [2015, 2016, 2019, 2016],
    'month': [2, 3, 8, 9],
    'day': [4, 5, 25, 15]} )

```

```py
df2 = pd.to_datetime(df)

```

```py
df2

```

> 
> 0 2015-02-04  
> 
> 1 2016-03-05  
> 
> 2 2019-08-25  
> 
> 3 2016-09-15  
> 
> dtype: datetime64[ns]
> 
> 
> 

```py
date1 = df2.iloc[1]

```

```py
date1

```

> 
> Timestamp('2016-03-05 00:00:00')
> 
> 
> 

```py
date2 = datetime.datetime(2016, 3, 5)

```

```py
date2

```

> 
> datetime.datetime(2016, 3, 5, 0, 0)
> 
> 
> 

```py
date1 == date2

```

> 
> True
> 
> 
>

Answer: 
As @not\_speshal wrote, the documentation is clear. With the module`inspect`, you can see `pandas.Timestamp` inherits from `datetime.datetime`.

```
>>> inspect.getmro(pd.Timestamp)
(pandas._libs.tslibs.timestamps.Timestamp,
 pandas._libs.tslibs.timestamps._Timestamp,
 pandas._libs.tslibs.base.ABCTimestamp,
 datetime.datetime,
 datetime.date,
 object)

```

For more details, you can read this two files [`timestamps.pyi`](https://github.com/pandas-dev/pandas/blob/1ff6970c256ea5d7de8cbf4ca9a3184663bef2b9/pandas/_libs/tslibs/timestamps.pyi#L31) and [`timestamps.pyx`](https://github.com/pandas-dev/pandas/blob/master/pandas/_libs/tslibs/timestamps.pyx#L2) from Pandas repository.
```
df2['Date']=pd.to_datetime(df2['Date'])#Coerce df2.Date to datetime assumming df2 is stand alone with own Date field
df['Date']=pd.to_datetime(df.apply(lambda x: x.astype(str).str.cat(sep='-'), axis=1))#Concat df entities to date string and coerce it to datettime
df['Date']==df2['Date']#Compare the two

```

outcome

```
0    True
1    True
2    True
3    True

```