A PyQT GUI application for converting InfoLease report outputs into Excel files. Handles parsing and summarizing. Learns where files are meant to be store and compiles monthly and yearly summaries.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
InfoLeaseExtract/venv/Lib/site-packages/pandas/tests/series/indexing/test_take.py

33 lines
963 B

import pytest
import pandas as pd
from pandas import Series
import pandas._testing as tm
def test_take():
ser = Series([-1, 5, 6, 2, 4])
actual = ser.take([1, 3, 4])
expected = Series([5, 2, 4], index=[1, 3, 4])
tm.assert_series_equal(actual, expected)
actual = ser.take([-1, 3, 4])
expected = Series([4, 2, 4], index=[4, 3, 4])
tm.assert_series_equal(actual, expected)
msg = lambda x: f"index {x} is out of bounds for( axis 0 with)? size 5"
with pytest.raises(IndexError, match=msg(10)):
ser.take([1, 10])
with pytest.raises(IndexError, match=msg(5)):
ser.take([2, 5])
def test_take_categorical():
# https://github.com/pandas-dev/pandas/issues/20664
ser = Series(pd.Categorical(["a", "b", "c"]))
result = ser.take([-2, -2, 0])
expected = Series(
pd.Categorical(["b", "b", "a"], categories=["a", "b", "c"]), index=[1, 1, 0]
)
tm.assert_series_equal(result, expected)