group by of this stroke:
[k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B
What I actually expected it to do:
[k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D
@alexcleac Just sort it before you group.
@deshipu meh, it becomes faster and easier to make the group by via dict by hands :/
@alexcleac "What I actually expected it to do:
A B C D"
s = set('AAAABBBCCDAABBB')
for i in sorted(s): print(i, end=" ")
A B C D
@manuelcaeiro nah, that is pretty not the task I was going to achieve :)
@alexcleac To be able to use Pandas' groupby you must have at least 2 groups of data. You have only one group in your example. :)
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either! We adhere to an adapted version of the TootCat Code of Conduct and have documented a list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators. Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!