Skip to content

Commit b3df72d

Browse files
gfyoungvictor
authored and
victor
committed
DOC: Correct docstring for check_dtype in assert_almost_equal (pandas-dev#21754)
1 parent d7bcd6b commit b3df72d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pandas/util/testing.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@ def assert_almost_equal(left, right, check_exact=False,
221221
right : object
222222
check_exact : bool, default False
223223
Whether to compare number exactly.
224-
check_dtype: bool, default True
225-
check dtype if both a and b are the same type
224+
check_dtype : bool / string {'equiv'}, default False
225+
Check dtype if both a and b are the same type. If 'equiv' is passed in,
226+
then `RangeIndex` and `Int64Index` are also considered equivalent
227+
when doing type checking.
226228
check_less_precise : bool or int, default False
227229
Specify comparison precision. Only used when `check_exact` is False.
228230
5 digits (False) or 3 digits (True) after decimal points are compared.
@@ -235,19 +237,22 @@ def assert_almost_equal(left, right, check_exact=False,
235237
check whether it is equivalent to 1 within the specified precision.
236238
"""
237239
if isinstance(left, pd.Index):
238-
return assert_index_equal(left, right, check_exact=check_exact,
240+
return assert_index_equal(left, right,
241+
check_exact=check_exact,
239242
exact=check_dtype,
240243
check_less_precise=check_less_precise,
241244
**kwargs)
242245

243246
elif isinstance(left, pd.Series):
244-
return assert_series_equal(left, right, check_exact=check_exact,
247+
return assert_series_equal(left, right,
248+
check_exact=check_exact,
245249
check_dtype=check_dtype,
246250
check_less_precise=check_less_precise,
247251
**kwargs)
248252

249253
elif isinstance(left, pd.DataFrame):
250-
return assert_frame_equal(left, right, check_exact=check_exact,
254+
return assert_frame_equal(left, right,
255+
check_exact=check_exact,
251256
check_dtype=check_dtype,
252257
check_less_precise=check_less_precise,
253258
**kwargs)

0 commit comments

Comments
 (0)