BoolColumnRefNode#

class pandas::BoolColumnRefNode#

pandas C++ class.

Example#

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

// Use BoolColumnRefNode
BoolColumnRefNode obj;
// ... operations ...

Other Methods#

Signature

Return Type

Location

Example

explicit BoolColumnRefNode(std::string col) : column(std::move(col))

explicit BoolColumnRefNode(std::string col) :

pd_query.h:358

View

NodeType type() const override

NodeType

pd_query.h:357

View

Code Examples#

The following examples are extracted from the test suite.

column (pd_test_1_all.cpp:22039)
22029            std::string a1 = result.iat<double>(1, col_a_idx) == -1.0 ? "ok" : "fail";
22030            std::string a2 = result.iat<double>(2, col_a_idx) == 3.0 ? "ok" : "fail";
22031            std::string a3 = result.iat<double>(3, col_a_idx) == 4.0 ? "ok" : "fail";
22032
22033            if (a0 != "ok" || a1 != "ok" || a2 != "ok" || a3 != "ok") {
22034                passed = false;
22035                error_msg = "Column A values incorrect: A[0]=" + a0 + ", A[1]=" + a1 +
22036                            ", A[2]=" + a2 + ", A[3]=" + a3;
22037            }
22038
22039            // Check B column (all should be original)
22040            double b0 = result.iat<double>(0, col_b_idx);
22041            if (b0 != 5.0) {
22042                passed = false;
22043                error_msg = "B[0] should be 5, got " + std::to_string(b0);
22044            }
22045
22046            if (!passed) {
22047                std::cout << "  [FAIL] : in pd_test_where_basic() : " << error_msg << std::endl;
22048                throw std::runtime_error("pd_test_where_basic failed: " + error_msg);
22049            }
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