ComparisonNode#

class pandas::ComparisonNode#

Query engine class for expression evaluation.

Example#

#include <pandas/pandas.h>
using namespace pandas;

// Use ComparisonNode
ComparisonNode obj;
// ... operations ...

Other Methods#

Signature

Return Type

Location

Example

NodeType type() const override

NodeType

pd_query.h:300

View

Code Examples#

The following examples are extracted from the test suite.

type (pd_test_3_all.cpp:15450)
15440/**
15441 * Test Series.convert_dtypes() parameter flags
15442 */
15443void pd_test_series_convert_dtypes_flags() {
15444    std::cout << "========= Series.convert_dtypes() flags =================";
15445
15446    // Test convert_integer=false - with floats disabled too, so it becomes string/object
15447    pandas::Series<std::string> s({"1", "2", "3"}, "numbers");
15448    auto converted = s.convert_dtypes(true, true, false, true, false);  // convert_integer=false, convert_floating=false
15449
15450    // Should remain object type (Series<std::string> has dtype_name()="object")
15451    // When integer and floating are both disabled for integer-like strings, it falls back to string type
15452    if (converted->dtype_name() != "object") {
15453        std::cout << "  [FAIL] : dtype should be object when convert_integer=false and convert_floating=false, got " << converted->dtype_name() << std::endl;
15454        throw std::runtime_error("pd_test_series_convert_dtypes_flags failed: convert_integer");
15455    }
15456
15457    // Test convert_boolean=false - strings stay as object/string type
15458    pandas::Series<std::string> s_bool({"true", "false"}, "bools");
15459    auto converted_bool = s_bool.convert_dtypes(true, true, true, false, true);  // convert_boolean=false