Skip to content

[RDataFrame] char type is not recognized in RDF.AsNumpy #22554

Description

@AlkaidCheng

Check duplicate issues.

  • Checked for duplicates

Description

Conversion of rdataframe containing columns with char type fails with an unknown object error. The expected behavior would be either converting the char data into int8, or byte.

Reproducer

import ROOT

ROOT.gInterpreter.Declare(
    r"""
    #ifndef DEF_MAKE_CHAR
    #define DEF_MAKE_CHAR
    Char_t make_Char_t(ULong64_t i) {
        return static_cast<Char_t>(65 + (i % 26)); // A, B, C, ...
    }
    char make_char(ULong64_t i) {
        return static_cast<char>(65 + (i % 26)); // A, B, C, ...
    }
    #endif
    """
)

rdf = (ROOT.RDataFrame(10)
    .Define("Char_t", "make_Char_t(rdfentry_)")
    .Define("char", "make_char(rdfentry_)"))

# both fails with
# TypeError: unknown object ABCDEFGHIJ
rdf.AsNumpy(['Char_t'])
rdf.AsNumpy(['char'])

ROOT version

6.38.04

Installation method

conda, lcg

Operating system

Linux (SLES 15.6)

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions