You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: web/pandas/about/roadmap.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,8 +87,8 @@ should result on cleaner, simpler, and more performant code.
87
87
1. Label indexing must never involve looking in an axis twice for the same label(s).
88
88
This implies that any validation step must either:
89
89
90
-
* limit validation to general features (e.g. dtype/structure of the key/index), or
91
-
* reuse the result for the actual indexing.
90
+
* limit validation to general features (e.g. dtype/structure of the key/index), or
91
+
* reuse the result for the actual indexing.
92
92
93
93
2. Indexers must never rely on an explicit call to other indexers.
94
94
For instance, it is OK to have some internal method of `.loc` call some
@@ -102,31 +102,30 @@ to `.iloc` should never involve the axes of the object in any way.
102
102
4. Indexing must never involve accessing/modifying values (i.e., act on `._data` or `.values`) more than once.
103
103
The following steps must hence be clearly decoupled:
104
104
105
-
* find positions we need to access/modify on each axis
106
-
* (if we are accessing) derive the type of object we need to return (dimensionality)
107
-
* actually access/modify the values
108
-
* (if we are accessing) construct the return object
105
+
* find positions we need to access/modify on each axis
106
+
* (if we are accessing) derive the type of object we need to return (dimensionality)
107
+
* actually access/modify the values
108
+
* (if we are accessing) construct the return object
109
109
110
110
5. As a corollary to the decoupling between 4.i and 4.iii, any code which deals on how data is stored
111
111
(including any combination of handling multiple dtypes, and sparse storage, categoricals, third-party types)
112
112
must be independent from code that deals with identifying affected rows/columns,
113
113
and take place only once step 4.i is completed.
114
114
115
-
* In particular, such code should most probably not live in `pandas/core/indexing.py`
116
-
* ... and must not depend in any way on the type(s) of axes (e.g. no `MultiIndex` special cases)
115
+
* In particular, such code should most probably not live in `pandas/core/indexing.py`
116
+
* ... and must not depend in any way on the type(s) of axes (e.g. no `MultiIndex` special cases)
117
117
118
118
6. As a corollary to point 1.i, `Index` (sub)classes must provide separate methods for any desired validity check of label(s) which does not involve actual lookup,
119
119
on the one side, and for any required conversion/adaptation/lookup of label(s), on the other.
120
120
121
121
7. Use of trial and error should be limited, and anyway restricted to catch only exceptions
122
122
which are actually expected (typically `KeyError`).
123
123
124
-
* In particular, code should never (intentionally) raise new exceptions in the `except` portion of a `try... exception`
124
+
* In particular, code should never (intentionally) raise new exceptions in the `except` portion of a `try... exception`
125
125
126
126
8. Any code portion which is not specific to setters and getters must be shared,
127
127
and when small differences in behavior are expected (e.g. getting with `.loc` raises for
128
128
missing labels, setting still doesn't), they can be managed with a specific parameter.
129
-
130
129
### Numba-accelerated operations
131
130
132
131
[Numba](https://numba.pydata.org) is a JIT compiler for Python code.
0 commit comments