Commit 2ac89a2
authored
chore(dependencies): support pandas 3 (#2723)
Recently pandas 3 was released.
Only minimal changes needed from us, namely
* switching timedelta units from deprecated "d" to "D"
* a fix in the model splitter where columns that were previously renamed automatically on dataframe construction must now be renamed manually due to stricter dataframe init method requirements
There are two other potentially relevant changes
* String dtype
Pandas 3 will infer string columns as str dtype instead of object. Code checking dtype == 'object' for strings will break. I think we are safe as internal dtype checks are generally on numpy arrays, not pandas DataFrames. We kind of luck out for having not migrated everything over to pandas.
When we do pd.DataFrame.from_records(recarray), numpy string fields will get converted to str dtype instead of object. But I don't think we need to care, indexing, selection, etc should all work as before.
* Copy-on-Write (CoW)
As far as I can tell we use .loc internally, no chained assignments, so we should be good.1 parent ef59774 commit 2ac89a2
4 files changed
Lines changed: 17 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
679 | | - | |
680 | | - | |
681 | | - | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
682 | 684 | | |
683 | 685 | | |
684 | 686 | | |
| |||
691 | 693 | | |
692 | 694 | | |
693 | 695 | | |
694 | | - | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
695 | 701 | | |
696 | 702 | | |
697 | | - | |
698 | | - | |
699 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
700 | 706 | | |
701 | 707 | | |
702 | 708 | | |
703 | 709 | | |
704 | | - | |
705 | | - | |
706 | | - | |
| 710 | + | |
707 | 711 | | |
708 | 712 | | |
709 | 713 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments