File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -7026,6 +7026,23 @@ def infer_objects(self, copy: bool = True) -> Index:
7026
7026
----------
7027
7027
copy : bool, default True
7028
7028
Whether to make a copy in cases where no inference occurs.
7029
+
7030
+ Returns
7031
+ -------
7032
+ Index
7033
+ An Index with a new dtype if the dtype was inferred
7034
+ or a shallow copy if the dtype could not be inferred.
7035
+
7036
+ See Also
7037
+ --------
7038
+ Index.inferred_type: Return a string of the type inferred from the values.
7039
+
7040
+ Examples
7041
+ --------
7042
+ >>> pd.Index(["a", 1]).infer_objects()
7043
+ Index(['a', '1'], dtype='object')
7044
+ >>> pd.Index([1, 2], dtype="object").infer_objects()
7045
+ Index([1, 2], dtype='int64')
7029
7046
"""
7030
7047
if self ._is_multi :
7031
7048
raise NotImplementedError (
You can’t perform that action at this time.
0 commit comments