NA_t#

class numpy::NA_t#

numpy C++ class.

Example#

#include <numpy/np_ndarray.h>
using namespace numpy;

// Use NA_t
NA_t obj;
// ... operations ...

Other Methods#

Signature

Return Type

Location

Example

explicit constexpr operator bool() const noexcept

explicit constexpr operator

df_na.h:49

View

std::string repr() const

constexpr bool operator>=(const T&) const noexcept { return false; } std::string

df_na.h:46

Code Examples#

The following examples are extracted from the test suite.

bool (np_test_4_all.cpp:1540)
1530      // std::cout << "  modf(uint64_t(100)) = (" << frac << ", " << integ << ") ✓\n";
1531    }
1532
1533    void test_scalar_bool() {
1534      std::cout << "Testing modf(bool_)...\n";
1535
1536      numpy::bool_ val_true = true;
1537      auto [frac1, integ1] = numpy::modf(val_true);
1538
1539      static_assert(std::is_same_v<decltype(frac1), double>, "bool_ should return double");
1540      if (!(approx_equal(frac1, 0.0) && "bool(true) fractional part should be 0.0")) {
1541          std::string description = std::string("test_scalar_bool():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(approx_equal(frac1, 0.0) && \"bool(true) fractional part should be 0.0\")";
1542          std::cout << std::string("[FAIL] ") + description << std::endl;
1543          throw std::runtime_error(description);
1544      }
1545      if (!(approx_equal(integ1, 1.0) && "bool(true) integer part should be 1.0")) {
1546          std::string description = std::string("test_scalar_bool():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(approx_equal(integ1, 1.0) && \"bool(true) integer part should be 1.0\")";
1547          std::cout << std::string("[FAIL] ") + description << std::endl;
1548          throw std::runtime_error(description);
1549      }