windowing

Apply expanding window on subsections of dataframe

Apply expanding window on subsections of dataframe Question: I have a dataframe like this key1 day feat 0 a 1 None 1 a 2 A 2 a 3 None 3 a 4 A 4 b 1 A 5 b 2 None 6 b 3 None 7 b 4 A I would like the apply an …

Total answers: 1

How to make recurrent list of lists with while-loop

How to make recurrent list of lists with while-loop Question: I have a file with the format turn_index t sentence t metadata and looks like this, where the length of dialogues (i.e. turns) is variable: 0 hello metadata1 1 hi! metadata2 0 hi there metadata3 1 how are you? metadata4 2 very well meta5 3 …

Total answers: 1

Restart windowing for loop

Restart windowing for loop Question: I have a list of strings, and I want to window them ‘n’ at a time. The window should re-start every time it encounters a certain string. This is the code I used: i = 0 a = [‘Abel’, ‘Bea’, ‘Clare’, ‘Abel’, ‘Ben’, ‘Constance’, ‘Dave’, ‘Emmet’, ‘Abel’, ‘Bice’, ‘Carol’, ‘Dennis’] …

Total answers: 2