LocProxy ======== .. cpp:class:: pandas::LocProxy pandas C++ class. Example ------- .. code-block:: cpp #include using namespace pandas; // Use LocProxy LocProxy obj; // ... operations ... Constructors ------------ .. list-table:: :widths: 55 25 20 :header-rows: 1 * - Signature - Location - Example * - ``LocProxy(DataFrame& df, const std::string& label1, const std::string& label2)`` - pd_dataframe.h:3652 - Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``operator DataFrame() const`` - operator - pd_dataframe.h:3693 - :ref:`View ` Code Examples ------------- The following examples are extracted from the test suite. .. _example-locproxy-dataframe-0: .. dropdown:: DataFrame (pd_test_1_all.cpp:22011) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 22001 :emphasize-lines: 11 void pd_test_where_basic() { std::cout << "========= where basic functionality ======================="; // Create DataFrame std::map> data; data["A"] = {1.0, 2.0, 3.0, 4.0}; data["B"] = {5.0, 6.0, 7.0, 8.0}; pandas::DataFrame df(data); // Create condition DataFrame (values > 2) std::map> cond_data; cond_data["A"] = {false, false, true, true}; // 1<=2, 2<=2, 3>2, 4>2 cond_data["B"] = {true, true, true, true}; // all >2 pandas::DataFrame cond(cond_data); // Apply where with replacement value -1 pandas::DataFrame result = df.where(cond, -1.0); // Get column index for A - it's sorted alphabetically in std::map size_t col_a_idx = df.get_column_index("A");