Top "Iterator" questions

An iterator is an object-oriented programming pattern that allows traversal through a collection, agnostic of the actual implementation or object addresses in physical memory.

python JSON only get keys in first level

I have a very long and complicated json object but I only want to get the items/keys in the …

python json python-2.7 iterator key
Get the first item from an iterable that matches a condition

I would like to get the first item from a list matching a condition. It's important that the resulting method …

python iterator
How to correctly implement custom iterators and const_iterators?

I have a custom container class for which I'd like to write the iterator and const_iterator classes. I never …

c++ iterator const-iterator
Iterator Loop vs index loop

Possible Duplicate: Why use iterators instead of array indices? I'm reviewing my knowledge on C++ and I've stumbled upon iterators. …

c++ loops c++11 indexing iterator
How to implement an STL-style iterator and avoid common pitfalls?

I made a collection for which I want to provide an STL-style, random-access iterator. I was searching around for an …

c++ iterator const-iterator
What does iterator->second mean?

In C++, what is the type of a std::map<>::iterator? We know that an object it of …

c++ stl iterator
Pointer to incomplete class type is not allowed

For some reason I cannot use functions attached to the object I want to use. I added a comment to …

c++ list class pointers iterator
Update row values where certain condition is met in pandas

Say I have the following dataframe: What is the most efficient way to update the values of the columns feat …

python pandas indexing iterator mask
What is the best way to get the count/length/size of an iterator?

Is there a "computationally" quick way to get the count of an iterator? int i = 0; for ( ; some_iterator.hasNext() ; ++i ) …

java iterator
How to get the current loop index when using Iterator?

I am using an Iterator to iterate through a collection and I want to get the current element's index. How …

java iterator