Skip to content

Commit

Permalink
intp stuff 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Terji Petersen authored and Terji Petersen committed Nov 17, 2022
1 parent 99c82ae commit b421767
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pandas/tests/indexes/ranges/test_range.py
Expand Up @@ -473,17 +473,17 @@ def test_slice_specialised(self, simple_index):

# positive slice values
index_slice = index[7:10:2]
expected = Index(np.array([14, 18]), name="foo")
expected = Index([14, 18], name="foo")
tm.assert_index_equal(index_slice, expected, exact="equiv")

# negative slice values
index_slice = index[-1:-5:-2]
expected = Index(np.array([18, 14]), name="foo")
expected = Index([18, 14], name="foo")
tm.assert_index_equal(index_slice, expected, exact="equiv")

# stop overshoot
index_slice = index[2:100:4]
expected = Index(np.array([4, 12]), name="foo")
expected = Index([4, 12], name="foo")
tm.assert_index_equal(index_slice, expected, exact="equiv")

# reverse
Expand All @@ -492,7 +492,7 @@ def test_slice_specialised(self, simple_index):
tm.assert_index_equal(index_slice, expected, exact="equiv")

index_slice = index[-8::-1]
expected = Index(np.array([4, 2, 0]), name="foo")
expected = Index([4, 2, 0], name="foo")
tm.assert_index_equal(index_slice, expected, exact="equiv")

index_slice = index[-40::-1]
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexing/test_indexing.py
Expand Up @@ -41,7 +41,7 @@ def test_setitem_ndarray_1d(self):
# GH5508

# len of indexer vs length of the 1d ndarray
df = DataFrame(index=Index(np.arange(1, 11)))
df = DataFrame(index=Index(np.arange(1, 11), dtype=np.int64))
df["foo"] = np.zeros(10, dtype=np.float64)
df["bar"] = np.zeros(10, dtype=complex)

Expand Down
1 change: 0 additions & 1 deletion pandas/tests/io/formats/test_format.py
Expand Up @@ -1335,7 +1335,6 @@ def test_to_string(self):
# big mixed
biggie = DataFrame(
{"A": np.random.randn(200), "B": tm.makeStringIndex(200)},
index=np.arange(200),
)

biggie.loc[:20, "A"] = np.nan
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/json/test_pandas.py
Expand Up @@ -395,7 +395,7 @@ def test_frame_mixedtype_orient(self): # GH10289
left = read_json(inp, orient=orient, convert_axes=False)
tm.assert_frame_equal(left, right)

right.index = np.arange(len(df))
right.index = pd.RangeIndex(len(df))
inp = df.to_json(orient="records")
left = read_json(inp, orient="records", convert_axes=False)
tm.assert_frame_equal(left, right)
Expand Down

0 comments on commit b421767

Please sign in to comment.