NA_t ==== .. cpp:class:: pandas::NA_t Utility class for pandas operations. Example ------- .. code-block:: cpp #include using namespace pandas; // Use NA_t NA_t obj; // ... operations ... Conversion ---------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``explicit constexpr operator bool() const noexcept`` - explicit constexpr operator - pd_na.h:49 - :ref:`View ` Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``std::string repr() const`` - constexpr bool operator>=(const T&) const noexcept { return false; } std::string - pd_na.h:46 - :ref:`View ` Code Examples ------------- The following examples are extracted from the test suite. .. _example-na_t-bool-0: .. dropdown:: bool (pd_test_3_all.cpp:1568) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 1558 :emphasize-lines: 11 } std::cout << " -> tests passed" << std::endl; } // ============================================================================ // Category 9: NA Functions // ============================================================================ void pd_test_3_all_na_functions() { std::cout << "========= NA_t.bool() and is_na ==================="; // Test NA_t bool conversion pandas::NA_t na_val; bool na_as_bool = static_cast(na_val); if (na_as_bool != false) { std::cout << " [FAIL] : in pd_test_3_all_na_functions() : NA should convert to false" << std::endl; throw std::runtime_error("pd_test_3_all_na_functions failed: NA bool conversion"); } // Test NA_t equality with itself .. _example-na_t-repr-1: .. dropdown:: repr (pd_test_1_all.cpp:10906) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 10896 :emphasize-lines: 11 std::cout << " -> tests passed" << std::endl; } void pd_test_extension_index_repr() { std::cout << "========= repr ========================="; pandas::CategoricalArray arr({"a", "b", "c"}); // Use ExtensionIndex directly to test base class repr pandas::ExtensionIndex idx(arr, "test"); std::string repr_str = idx.repr(); bool passed = (!repr_str.empty() && repr_str.find("ExtensionIndex") != std::string::npos); if (!passed) { std::cout << " [FAIL] : in pd_test_extension_index_repr() : repr check failed" << std::endl; throw std::runtime_error("pd_test_extension_index_repr failed"); } std::cout << " -> tests passed" << std::endl; }