Disturbing odd behavior/bug in Python itertools groupby?

前端 未结 3 1654
感情败类
感情败类 2021-01-23 07:38

I am using itertools.groupby to parse a short tab-delimited textfile. the text file has several columns and all I want to do is group all the entries that have a pa

3条回答
  •  梦毁少年i
    2021-01-23 08:34

    According to the documentation, groupby() groups only consecutive occurrences of the same key.

提交回复
热议问题