Skip to main content
Ctrl+K
cudf 24.12.00 documentation - Home cudf 24.12.00 documentation - Home
  • cuDF User Guide
  • cudf.pandas
  • Polars GPU engine
  • libcudf documentation
  • Developer Guide
  • GitHub
  • Twitter
  • cuDF User Guide
  • cudf.pandas
  • Polars GPU engine
  • libcudf documentation
  • Developer Guide
  • GitHub
  • Twitter

章节导航

目录:

  • libcudf 文档
    • libcudf
    • Default Stream
    • 内存资源管理
    • Cudf Classes
      • 列类
        • 列工厂
        • 字典类
        • Lists Classes
        • 字符串类
        • Structs Classes
        • 时间戳类
      • Table Classes
      • Scalar Classes
        • 标量工厂
      • Fixed Point Classes
    • 列API
      • 列复制
        • 复制连接
        • Copy Gather
        • Copy Scatter
        • Copy Slice
        • Copy Split
        • Copy Shift
      • 列空掩码
      • Column Sort
      • Column Search
      • 列哈希
      • 列合并
      • 列连接
      • 列分位数
      • 列聚合
        • 聚合工厂
        • Aggregation Reduction
        • Aggregation Groupby
        • Aggregation Rolling
      • 列转换
        • Transformation Unaryops
        • Transformation Binaryops
        • Transformation Transform
        • Transformation Replace
        • Transformation Fill
      • 列重塑
        • Reshape Transpose
      • 列重新排序
        • 重新排序分区
        • 重新排序紧凑
      • 列互操作
        • Interop Dlpack
        • Interop Arrow
    • Datetime APIs
      • Datetime Extract
      • Datetime Compute
    • Strings APIs
      • Strings Case
      • 字符串类型
      • 字符串组合
      • Strings Contains
      • 字符串转换
      • 字符串复制
      • 字符串切片
      • Strings Find
      • 字符串修改
      • 字符串替换
      • Strings Split
      • Strings Extract
      • Strings Regex
    • Dictionary APIs
      • Dictionary Encode
      • 字典搜索
      • 字典更新
    • Io APIs
      • Io Types
      • Io Readers
      • Io Writers
      • Io Datasources
      • Io Datasinks
    • JSON APIs
      • JSON 对象
    • Lists APIs
      • Lists Combine
      • Lists Modify
      • Lists Extract
      • Lists Filling
      • Lists Contains
      • Lists Gather
      • 列表元素
      • 列表过滤
      • Lists Sort
      • 集合操作
    • Nvtext APIs
      • Nvtext Ngrams
      • Nvtext 标准化
      • Nvtext Stemmer
      • Nvtext 编辑距离
      • Nvtext Tokenize
      • Nvtext Replace
      • Nvtext Minhash
      • Nvtext Jaccard
    • Utility APIs
      • 实用工具类型
      • Utility Dispatcher
      • Utility Bitmask
      • Utility Error
      • Utility Span
    • Labeling APIs
      • Label Bins
    • 表达式评估
    • tdigest
  • Regex Features
  • Unicode 限制
  • libcudf 文档
  • libcudf 文档
  • 字典API
  • 字典搜索

字典搜索#

group dictionary_search

函数

std::unique_ptr<scalar> get_index(dictionary_column_view const &dictionary, scalar const &key, rmm::cuda_stream_view stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref())#

返回给定键的索引值。

如果字典中不存在该键,返回的标量将具有 is_valid()==false

Throws:

cudf::logic_error – 如果 key.type() != dictionary.keys().type()

Parameters:
  • dictionary – 用于搜索键的字典。

  • key – 在字典键集中搜索的值。

  • stream – 用于设备内存操作和内核启动的CUDA流。

  • mr – 用于分配返回标量的设备内存的设备内存资源。

Returns:

字典中键的数值标量索引值。

上一页

Dictionary Encode

下一步

字典更新

Show Source