File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -362,6 +362,9 @@ class Index(IndexOpsMixin, PandasObject):
362
362
An Index instance can **only** contain hashable objects.
363
363
An Index instance *can not* hold numpy float16 dtype.
364
364
365
+ The `names` argument is only relevant when the data results in a `MultiIndex`.
366
+ When constructing a regular `Index`, use `name=` to assign a name. Passing `names=` will have no effect unless a `MultiIndex` is created.
367
+
365
368
Examples
366
369
--------
367
370
>>> pd.Index([1, 2, 3])
@@ -372,8 +375,15 @@ class Index(IndexOpsMixin, PandasObject):
372
375
373
376
>>> pd.Index([1, 2, 3], dtype="uint8")
374
377
Index([1, 2, 3], dtype='uint8')
378
+
379
+ >>> pd.Index([], name='a').name
380
+ 'a'
381
+
382
+ >>> pd.Index([], names=['a']).name is None
383
+ True
375
384
"""
376
385
386
+
377
387
# similar to __array_priority__, positions Index after Series and DataFrame
378
388
# but before ExtensionArray. Should NOT be overridden by subclasses.
379
389
__pandas_priority__ = 2000
You can’t perform that action at this time.
0 commit comments