tagged [iteration]

Is there a way in Pandas to use previous row value in dataframe.apply when previous value is also calculated in the apply?

Is there a way in Pandas to use previous row value in dataframe.apply when previous value is also calculated in the apply? I have the following dataframe: Require: ``` Index_Date A B C

Fastest way to iterate over all the chars in a String

Fastest way to iterate over all the chars in a String In Java, what would the fastest way to iterate over all the chars in a String, this: ``` String str = "a really, really long string"; for (int i =...

17 Jan at 14:24

Best way to iterate over a list and remove items from it?

Best way to iterate over a list and remove items from it? I need to iterate over a `List` and remove items that answer a certain condition. I saw this answer ([https://stackoverflow.com/a/1582317/5077...

23 May at 12:24

How to loop through an array containing objects and access their properties

How to loop through an array containing objects and access their properties I want to cycle through the objects contained in an array and change the properties of each one. If I do this: ``` for (var ...

2 May at 08:19

How do I iterate over the properties of an anonymous object in C#?

How do I iterate over the properties of an anonymous object in C#? I want to take an anonymous object as argument to a method, and then iterate over its properties to add each property/value to a a dy...

Python: Adding element to list while iterating

Python: Adding element to list while iterating I know that it is not allowed to remove elements while iterating a list, but is it allowed to add elements to a python list while iterating. Here is an e...

5 Dec at 22:37

Iterate over object attributes in python

Iterate over object attributes in python I have a python object with several attributes and methods. I want to iterate over object attributes. I want to generate a dictionary containing all of the ob...

22 Oct at 19:23

Existing LINQ extension method similar to Parallel.For?

Existing LINQ extension method similar to Parallel.For? > [LINQ equivalent of foreach for IEnumerable](https://stackoverflow.com/questions/200574/linq-equivalent-of-foreach-for-ienumerablet) The lin...

23 May at 12:18

Why isn't IEnumerable consumed?/how do generators work in c# compared to python

Why isn't IEnumerable consumed?/how do generators work in c# compared to python So I thought I understood c# yield return as being largely the same as pythons yield which I thought that I understood. ...

1 May at 16:51

What is the fastest/safest method to iterate over a HashSet?

What is the fastest/safest method to iterate over a HashSet? I'm still quite new to C#, but noticed the advantages through forum postings of using a `HashSet` instead of a `List` in specific cases. My...

26 Feb at 19:0