Skip to content

Commit 6c15341

Browse files
author
MarcoGorelli
committed
[skip ci] rewording a bit
1 parent d950516 commit 6c15341

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

web/pandas/pdeps/0005-no-default-index-mode.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ in some cases:
8383
- `name` could only be `None`;
8484
- `start` could only be `0`, `step` `1`;
8585
- when appending a ``NoRowIndex``, the result would still be ``NoRowIndex``;
86-
- when slicing, one would still get a `NoIndex`;
86+
- when slicing, one would still get a `NoRowIndex`;
8787
- it could only be aligned with another ``Index`` if it's also ``NoRowIndex`` and if it's of the same length;
88-
- ``DataFrame`` columns can't be `NoRowIndex` (so ``transpose`` would need some adjustments when called on a ``NoIndex`` ``DataFrame``);
88+
- ``DataFrame`` columns can't be `NoRowIndex` (so ``transpose`` would need some adjustments when called on a ``NoRowIndex`` ``DataFrame``);
8989
- `insert` and `delete` should raise. As a consequence, if ``df`` is a ``DataFrame`` with a
9090
``NoRowIndex``, then `df.drop` with `axis=0` would always raise;
9191
- arithmetic operations (e.g. `NoRowIndex(3) + 2`) would always raise.
@@ -186,11 +186,10 @@ One issue that arises, then, is what to do about ``transpose``, which would swap
186186
index and columns. Rather than making ``transpose`` break, it could be more
187187
user-friendly to, within ``transpose`` change a ``NoRowIndex`` index to a
188188
``RangeIndex`` of the same length before swapping index and columns.
189-
Note that calling ``transpose`` twice would no longer round-trip.
190189

191190
### DataFrameFormatter and SeriesFormatter changes
192191

193-
When printing an object with a ``NoIndex``, then the row labels wouldn't be shown:
192+
When printing an object with a ``NoRowIndex``, then the row labels wouldn't be shown:
194193

195194
```python
196195
In [15]: df = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}, index=NoRowIndex(3))
@@ -228,8 +227,9 @@ Draft pull request showing proof of concept: https://github.com/pandas-dev/panda
228227

229228
**A:** Yes! And they're also confusing to many users, even experienced developers.
230229
It's fairly common to see pandas code with ``.reset_index`` scattered around every
231-
other line. Such users would benefit from a mode in which they wouldn't need to think
232-
about indices and alignment.
230+
other line. Such users would benefit from being able to not think about indices
231+
and alignment. Indices would be here to stay, and ``NoRowIndex`` would not be the
232+
default.
233233

234234
**Q: In this mode, could users still get an ``Index`` if they really wanted to?**
235235

@@ -242,8 +242,6 @@ Draft pull request showing proof of concept: https://github.com/pandas-dev/panda
242242
df.reset_index().set_index('index')
243243
```
244244

245-
**Q: Why can't a DataFrame columns be ``NoRowIndex``?**
246-
247245

248246
## PDEP History
249247

0 commit comments

Comments
 (0)