eland.DataFrame.select_dtypes#
- DataFrame.select_dtypes(include=None, exclude=None) DataFrame #
根据列数据类型返回 DataFrame 的列子集。
与 pandas.DataFrame.select_dtypes 兼容
返回#
- eland.DataFrame
仅包含选定数据类型列的 DataFrame
示例#
>>> df = ed.DataFrame('http://localhost:9200', 'flights', ... columns=['AvgTicketPrice', 'Dest', 'Cancelled', 'timestamp', 'dayOfWeek']) >>> df.dtypes AvgTicketPrice float64 Dest object Cancelled bool timestamp datetime64[ns] dayOfWeek int64 dtype: object >>> df = df.select_dtypes(include=[np.number, 'datetime']) >>> df.dtypes AvgTicketPrice float64 timestamp datetime64[ns] dayOfWeek int64 dtype: object