用法:
IntervalIndex.from_breaks(closed='right', name=None, copy=False, dtype=None)
從拆分數組構造一個 IntervalIndex。
- breaks:array-like(一維)
每個區間的左右邊界。
- closed:{“left”, “right”, “both”, “neither”},默認 “right”
left-side、right-side 上的間隔是否關閉,兩者都關閉或都不關閉。
- copy:布爾值,默認為 False
複製輸入數據。
- name:對象,可選
要存儲在索引中的名稱。
- dtype:dtype 或無,默認無
如果沒有,將推斷 dtype。
- 區間索引
參數:
返回:
例子:
>>> import cudf >>> import pandas as pd >>> cudf.IntervalIndex.from_breaks([0, 1, 2, 3]) IntervalIndex([(0, 1], (1, 2], (2, 3]], dtype='interval')
相關用法
- Python cudf.IntervalIndex.get_loc用法及代碼示例
- Python cudf.Index.is_boolean用法及代碼示例
- Python cudf.Index.astype用法及代碼示例
- Python cudf.Index.set_names用法及代碼示例
- Python cudf.Index.is_numeric用法及代碼示例
- Python cudf.Index.sort_values用法及代碼示例
- Python cudf.Index.union用法及代碼示例
- Python cudf.Index.is_integer用法及代碼示例
- Python cudf.Index.join用法及代碼示例
- Python cudf.Index.get_level_values用法及代碼示例
- Python cudf.Index.isin用法及代碼示例
- Python cudf.Index.rename用法及代碼示例
- Python cudf.Index.to_pandas用法及代碼示例
- Python cudf.Index.difference用法及代碼示例
- Python cudf.Index.is_object用法及代碼示例
- Python cudf.Index.from_pandas用法及代碼示例
- Python cudf.Index.is_categorical用法及代碼示例
- Python cudf.Index.append用法及代碼示例
- Python cudf.Index.is_interval用法及代碼示例
- Python cudf.Index.intersection用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cudf.IntervalIndex.from_breaks。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。