Created
October 5, 2021 18:25
-
-
Save kevin3/9fa8622ae7abf40d806e957270ba3788 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def read_date(date): | |
if isinstance(date, int): | |
return pd.to_datetime(date,unit='D', origin='1899-12-30') | |
#return xlrd.xldate.xldate_as_datetime(date, 0) | |
else: | |
return(pd.to_datetime(date)) | |
print("Converting 42985 to") | |
print(read_date(42985 )) | |
print("Converting ") | |
print(filtered_class['Posting_Date'][3637192]) | |
print(read_date(filtered_class['Posting_Date'][3637192])) | |
print(pd.to_datetime(42985,unit='D', origin='1899-12-30')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment