RowsRange#

class pandas::RowsRange#

Iterator class for traversing pandas data structures.

Example#

#include <pandas/pandas.h>
using namespace pandas;

// Use RowsRange
RowsRange obj;
// ... operations ...

Iteration#

Signature

Return Type

Location

Example

RowIterator begin() const

RowIterator

pd_dataframe.h:2237

View

RowIterator end() const

RowIterator

pd_dataframe.h:2241

View

Other Methods#

Signature

Return Type

Location

Example

explicit RowsRange(const DataFrame\* df) : df_(df)

explicit RowsRange(const DataFrame* df) :

pd_dataframe.h:2235

Code Examples#

The following examples are extracted from the test suite.

begin (pd_test_1_all.cpp:457)
447        };
448        pandas::CategoricalArray arr(values);
449
450        const std::vector<std::string>& cats = arr.categories();
451        if (cats.size() != 3) {
452            std::cout << "  [FAIL] : in pd_test_categorical_array_categories_property() : categories size != 3" << std::endl;
453            throw std::runtime_error("pd_test_categorical_array_categories_property failed: categories size != 3");
454        }
455
456        // Categories should be unique
457        std::set<std::string> unique_cats(cats.begin(), cats.end());
458        if (unique_cats.size() != cats.size()) {
459            std::cout << "  [FAIL] : in pd_test_categorical_array_categories_property() : categories not unique" << std::endl;
460            throw std::runtime_error("pd_test_categorical_array_categories_property failed: categories not unique");
461        }
462
463        std::cout << " -> tests passed" << std::endl;
464    }
465
466    void pd_test_categorical_array_codes_property() {
467        std::cout << "========= CategoricalArray: codes property ======================= ";
end (pd_test_1_all.cpp:457)
447        };
448        pandas::CategoricalArray arr(values);
449
450        const std::vector<std::string>& cats = arr.categories();
451        if (cats.size() != 3) {
452            std::cout << "  [FAIL] : in pd_test_categorical_array_categories_property() : categories size != 3" << std::endl;
453            throw std::runtime_error("pd_test_categorical_array_categories_property failed: categories size != 3");
454        }
455
456        // Categories should be unique
457        std::set<std::string> unique_cats(cats.begin(), cats.end());
458        if (unique_cats.size() != cats.size()) {
459            std::cout << "  [FAIL] : in pd_test_categorical_array_categories_property() : categories not unique" << std::endl;
460            throw std::runtime_error("pd_test_categorical_array_categories_property failed: categories not unique");
461        }
462
463        std::cout << " -> tests passed" << std::endl;
464    }
465
466    void pd_test_categorical_array_codes_property() {
467        std::cout << "========= CategoricalArray: codes property ======================= ";