@@ -93,35 +93,6 @@ class Index(FrozenNDArray):
93
93
94
94
_engine_type = _index .ObjectEngine
95
95
96
- def is_ (self , other ):
97
- """
98
- More flexible, faster check like ``is`` but that works through views
99
-
100
- Note: this is *not* the same as ``Index.identical()``, which checks
101
- that metadata is also the same.
102
-
103
- Parameters
104
- ----------
105
- other : object
106
- other object to compare against.
107
-
108
- Returns
109
- -------
110
- True if both have same underlying data, False otherwise : bool
111
- """
112
- # use something other than None to be clearer
113
- return self ._id is getattr (other , '_id' , Ellipsis )
114
-
115
- def _reset_identity (self ):
116
- "Initializes or resets ``_id`` attribute with new object"
117
- self ._id = _Identity ()
118
-
119
- def view (self , * args , ** kwargs ):
120
- result = super (Index , self ).view (* args , ** kwargs )
121
- if isinstance (result , Index ):
122
- result ._id = self ._id
123
- return result
124
-
125
96
def __new__ (cls , data , dtype = None , copy = False , name = None , fastpath = False ,
126
97
** kwargs ):
127
98
@@ -187,6 +158,35 @@ def __new__(cls, data, dtype=None, copy=False, name=None, fastpath=False,
187
158
subarr ._set_names ([name ])
188
159
return subarr
189
160
161
+ def is_ (self , other ):
162
+ """
163
+ More flexible, faster check like ``is`` but that works through views
164
+
165
+ Note: this is *not* the same as ``Index.identical()``, which checks
166
+ that metadata is also the same.
167
+
168
+ Parameters
169
+ ----------
170
+ other : object
171
+ other object to compare against.
172
+
173
+ Returns
174
+ -------
175
+ True if both have same underlying data, False otherwise : bool
176
+ """
177
+ # use something other than None to be clearer
178
+ return self ._id is getattr (other , '_id' , Ellipsis )
179
+
180
+ def _reset_identity (self ):
181
+ "Initializes or resets ``_id`` attribute with new object"
182
+ self ._id = _Identity ()
183
+
184
+ def view (self , * args , ** kwargs ):
185
+ result = super (Index , self ).view (* args , ** kwargs )
186
+ if isinstance (result , Index ):
187
+ result ._id = self ._id
188
+ return result
189
+
190
190
# construction helpers
191
191
@classmethod
192
192
def _scalar_data_error (cls , data ):
0 commit comments