pytimetk
pytimetk copied to clipboard
Inconsistent sorting - make more obvious
Thinking of adding a sort parameter to these functions to make it more obvious to what's happening under the hood.
One issue is that when sorting, the order of the groups are changing. So maybe make this optional.
Switched from using data.apply(lambda x: x) to data.obj.copy(). The former sorts groups alphabetically. The latter maintains the order of the original data.
Next on my list is to tackle these. Make them optional with sort = True as default.
df.sort_values(by=[*group_names, date_column], inplace=True)