Data is not correct in output when change to 2021 in pandas dataframe

Please format your code as code, as described in About the Users category, and please copy and paste the exact function calls your tried and the output you got. It is impossible for anybody to understand why something is going wrong without seeing what is going wrong.

That being said, that’s a rather odd way to create a date object. You could just use the standard constructor.