LookupResult#
-
class pandas::LookupResult#
pandas C++ class.
Example#
#include <pandas/pandas.h>
using namespace pandas;
// Use LookupResult
LookupResult obj;
// ... operations ...
Other Methods#
Signature |
Return Type |
Location |
Example |
|---|---|---|---|
|
static LookupResult<T> |
pd_index_lookup.h:48 |
|
|
static LookupResult<T> |
pd_index_lookup.h:40 |
Code Examples#
The following examples are extracted from the test suite.
miss (pd_test_5_all.cpp:83706)
83696 catch (const pandas::KeyError&) { ok_typed = true; }
83697 catch (const std::out_of_range&) { ok_std = true; }
83698 catch (const std::exception&) { ok_std = true; }
83699 pandas_tests::check(ok_typed || ok_std,
83700 "case_20.idx_get_loc_nan_missing.throws_some_keyerror",
83701 local_fail);
83702 }
83703
83704 // Series<double> built over a NaN-bearing index then get_loc(NaN)
83705 // probe via the underlying Index — exercises NaN equality path on
83706 // a label miss (separate from the integer index case above).
83707 {
83708 bool ok_typed = false;
83709 bool ok_std = false;
83710 try {
83711 const double nan_v = std::numeric_limits<double>::quiet_NaN();
83712 pandas::Index<double> idx({nan_v, 10.0, 20.0});
83713 // Looking up a value that's not in the index where one
83714 // entry is NaN — must still resolve to KeyError post-90a.
83715 (void)idx.get_loc(999.0);
83716 }