[PYTHON] Type after reading an excel file with pandas read_excel

The data type after reading Excel with pandas.read_excel seems to be affected by the formatting in Excel, so I was a little worried, so I experimented. Accumulate little by little.

スクリーンショット 2020-10-14 21.01.29.png

date

--Environment --macOS Catalina version 10.15.7 --Microsoft Excel for Mac version 16.42 - Python 3.8.5 - pandas 1.1.3

Excel format(Classification) Excel format(display) Type after loading with pandas
standard 43831 int
date 2020/1/2 datetime.datetime
date Friday, January 3, 2020 datetime.datetime
date 2020-01-04 pandas.Timestamp
date January 5, 2020 pandas.Timestamp
date January 2020 pandas.Timestamp
date January 7 pandas.Timestamp
date 2020/1/8 pandas.Timestamp
date 2020/1/9 12:00 AM pandas.Timestamp
date 2020/1/10 0:00 pandas.Timestamp
date 1/11 pandas.Timestamp
date 1/12/20 pandas.Timestamp
date 01/13/20 pandas.Timestamp
date 14-Jan pandas.Timestamp
date 15-Jan-20 pandas.Timestamp
date 16-Jan-20 pandas.Timestamp
date Jan-20 pandas.Timestamp
date January-20 pandas.Timestamp
date J pandas.Timestamp
date J-20 pandas.Timestamp

-Since the Excel date read by pandas.read_excel was a serial number, I converted it to datetime.datetime --Qiita

Recommended Posts

Type after reading an excel file with pandas read_excel
Create an Excel file with Python3
How to read an Excel file (.xlsx) with Pandas [Python]
Quickly create an excel file with Python #python
[Easy Python] Reading Excel files with pandas
[Python] How to read excel file with pandas
Reading pandas format file
Reading, summarizing, visualizing, and exporting time series data to an Excel file with Python
Try to operate an Excel file using Python (Pandas / XlsxWriter) ①
Try to operate an Excel file using Python (Pandas / XlsxWriter) ②
[Python] How to output a pandas table to an excel file
How to paste a CSV file into an Excel file using Pandas
Create an age group with pandas
Excel aggregation with Python pandas Part 1
I get an error with import pandas.
Excel aggregation with Python pandas Part 2 Variadic
[Easy Python] Reading Excel files with openpyxl
[pandas] .csv file reading and display method
Create an upgradeable msi file with cx_Freeze
Speaking Japanese with gTTS (reading a text file)
Send an email with Excel attached in Python
Use Pandas to write only the specified lines of the data frame to an excel file