LoginSignup
1
5

More than 3 years have passed since last update.

pandasのread_excelでExcelファイルを読み込んだ後の型

Last updated at Posted at 2020-10-14

pandas.read_excelでExcelを読み込んだ後のデータ型はExcelでの書式設定が影響するようなのでちょっと気になったので実験してみた。ちょっとづつ貯めていく。

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

日付

  • 環境
    • macOS Catalina バージョン10.15.7
    • Microsoft Excel for Mac バージョン16.42
    • Python 3.8.5
    • pandas 1.1.3
Excel書式(分類) Excel書式(表示) pandasで読み込んだ後の型
標準 43831 int
日付 2020/1/2 datetime.datetime
日付 2020年1月3日 金曜日 datetime.datetime
日付 2020-01-04 pandas.Timestamp
日付 2020年1月5日 pandas.Timestamp
日付 2020年1月 pandas.Timestamp
日付 1月7日 pandas.Timestamp
日付 2020/1/8 pandas.Timestamp
日付 2020/1/9 12:00 AM pandas.Timestamp
日付 2020/1/10 0:00 pandas.Timestamp
日付 1/11 pandas.Timestamp
日付 1/12/20 pandas.Timestamp
日付 01/13/20 pandas.Timestamp
日付 14-Jan pandas.Timestamp
日付 15-Jan-20 pandas.Timestamp
日付 16-Jan-20 pandas.Timestamp
日付 Jan-20 pandas.Timestamp
日付 January-20 pandas.Timestamp
日付 J pandas.Timestamp
日付 J-20 pandas.Timestamp

時間

  • 環境
    • macOS Catalina バージョン10.15.7
    • Microsoft Excel for Mac バージョン16.42
    • Python 3.8.5
    • pandas 1.1.3
Excel書式
(分類)
Excel書式
(種類)
Excel書式
(表示)
Excel値 pandasで読み込んだ後の型
ユーザー
定義
24時未満
[h]:mm
0:00
23:59
0:00:00
23:59:00
datetime.time(00:00:00)
datetime.time(23:59:00)
ユーザー
定義
24時以降
[h]:mm
24:00
26:00
1900/1/1 0:00:00
1900/1/1 2:00:00
datetime.datetime(1900-01-01 00:00:00)
datetime.datetime(1900-01-01 02:00:00)
時刻 - 10:00 datetime.time
1
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
5