I'm trying to iterate over a dataframe, and for each row, if column A has 1 add one to the counter, if it has 0 don't count the line in the counter (but don't skip it). When we reach 10 for the counter, take all the rows and put them in an array and restart the counter. After searching a bit, it seems that generators could do the trick but I have a bit of trouble with them. So far I have something like this.
data = [login to view URL]([login to view URL](0,50,size=(50, 4)), columns=list('ABCD'))
data['C'] = [login to view URL](2, size=50)
data
counter = 0
chunk = 10
arrays = []
for x in range(0, len(data), chunk):
array = [login to view URL][x: x+chunk]
[login to view URL](array)
print(array)
that's what my code looks like for now. I'd like to replace the step(currently chunk) so that it is a variable step because each chunk will be of a different size(currently they are all 10 rows each). I put pandas as an example to simplify but I actually use another library called vaex, very similar to pandas but for larger dataframes (100 Million rows +). It has almost the same caracteristics, but it does not have functions like cumsum or groupby, that's why I want to use a for loop.
github: [login to view URL]
Hi
I am a senior ML & AI developer. I have read your requirement very carefully.
I have 2+ years of ML & AI development and get a lot of experience.
My main skills are:
FrontEnd ,Data Scrapping, ML, Deep Learning ,several classifier methods
My hard and honest work will satisfy you.
For example, I can work for 8~12 hours a day from Monday through Friday and then spend whole weekend for you if needed.
I will keep deadline and my good result will improve our relationship.
I hope to work with you and pioneer the new phase of your project.
Please contact me and discuss with me.
Best Regards
Sagar Bhalke