LookupResult ============ .. cpp:class:: pandas::LookupResult pandas C++ class. Example ------- .. code-block:: cpp #include using namespace pandas; // Use LookupResult LookupResult obj; // ... operations ... Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``static LookupResult miss()`` - static LookupResult - pd_index_lookup.h:48 - :ref:`View ` * - ``static LookupResult scalar_at(T value)`` - static LookupResult - pd_index_lookup.h:40 - Code Examples ------------- The following examples are extracted from the test suite. .. _example-lookupresult-miss-0: .. dropdown:: miss (pd_test_5_all.cpp:83706) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 83696 :emphasize-lines: 11 catch (const pandas::KeyError&) { ok_typed = true; } catch (const std::out_of_range&) { ok_std = true; } catch (const std::exception&) { ok_std = true; } pandas_tests::check(ok_typed || ok_std, "case_20.idx_get_loc_nan_missing.throws_some_keyerror", local_fail); } // Series built over a NaN-bearing index then get_loc(NaN) // probe via the underlying Index — exercises NaN equality path on // a label miss (separate from the integer index case above). { bool ok_typed = false; bool ok_std = false; try { const double nan_v = std::numeric_limits::quiet_NaN(); pandas::Index idx({nan_v, 10.0, 20.0}); // Looking up a value that's not in the index where one // entry is NaN — must still resolve to KeyError post-90a. (void)idx.get_loc(999.0); }