私はこのパンダのデータフレームを持っています:
<class 'pandas.core.frame.DataFrame'>
Float64Index: 880 entries, -440.0 to 439.0
Data columns (total 7 columns):
Channel 3 (A3) 880 non-null values
Channel 4 (A4) 880 non-null values
Channel 5 (A5) 880 non-null values
Channel 6 (A6) 880 non-null values
Channel 7 (B1) 880 non-null values
Channel 8 (B2) 880 non-null values
Channel 9 (B3) 880 non-null values
dtypes: float64(7)
したがって、ここでdtypesは、float64が7回あることを示していますが、メンバーdtypesを見ると:
df.dtypes
Channel 3 (A3) float64
Channel 4 (A4) float64
Channel 5 (A5) float64
Channel 6 (A6) float64
Channel 7 (B1) float64
Channel 8 (B2) float64
Channel 9 (B3) float64
dtype: object
Q1: なぜ「オブジェクト」と書かれているのですか?
最初にこれを見つけた方法は次のとおりです。hdfとして保存しようとしたところ、大きなパフォーマンス警告が表示されました。
/Users/maye/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas-0.12.0_1007_g6eba2e4-py2.7-macosx-10.6-x86_64.egg/pandas/io/pytables.py:2325: PerformanceWarning:
your performance may suffer as PyTables will pickle object types that it cannot
map directly to c-types [inferred_type->unicode,key->axis0] [items->None]
warnings.warn(ws, PerformanceWarning)
/Users/maye/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas-0.12.0_1007_g6eba2e4-py2.7-macosx-10.6-x86_64.egg/pandas/io/pytables.py:2325: PerformanceWarning:
your performance may suffer as PyTables will pickle object types that it cannot
map directly to c-types [inferred_type->unicode,key->block0_items] [items->None]
warnings.warn(ws, PerformanceWarning)
Q2: float64 は HDF ストレージでまだサポートされていませんか、それともバグですか?
私のパンダのバージョン: '0.12.0-1007-g6eba2e4' そして、最初に read_excel でこのデータフレームを作成し、いくつかのクリーンアップを行い、float64 データ型を取得するために df.convert_objects() で終了しました。
編集: Unicode 列名が警告の原因でした。以下の Jeff のコメントも参照してください。