Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /proc/thread-self/root/usr/local/lib/python3.8/dist-packages/pandas/tests/series/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : //proc/thread-self/root/usr/local/lib/python3.8/dist-packages/pandas/tests/series/test_unary.py

import pytest

from pandas import Series
import pandas._testing as tm


class TestSeriesUnaryOps:
    # __neg__, __pos__, __inv__

    def test_neg(self):
        ser = tm.makeStringSeries()
        ser.name = "series"
        tm.assert_series_equal(-ser, -1 * ser)

    def test_invert(self):
        ser = tm.makeStringSeries()
        ser.name = "series"
        tm.assert_series_equal(-(ser < 0), ~(ser < 0))

    @pytest.mark.parametrize(
        "source, target",
        [
            ([1, 2, 3], [-1, -2, -3]),
            ([1, 2, None], [-1, -2, None]),
            ([-1, 0, 1], [1, 0, -1]),
        ],
    )
    def test_unary_minus_nullable_int(
        self, any_signed_nullable_int_dtype, source, target
    ):
        dtype = any_signed_nullable_int_dtype
        ser = Series(source, dtype=dtype)
        result = -ser
        expected = Series(target, dtype=dtype)
        tm.assert_series_equal(result, expected)

    @pytest.mark.parametrize("source", [[1, 2, 3], [1, 2, None], [-1, 0, 1]])
    def test_unary_plus_nullable_int(self, any_signed_nullable_int_dtype, source):
        dtype = any_signed_nullable_int_dtype
        expected = Series(source, dtype=dtype)
        result = +expected
        tm.assert_series_equal(result, expected)

    @pytest.mark.parametrize(
        "source, target",
        [
            ([1, 2, 3], [1, 2, 3]),
            ([1, -2, None], [1, 2, None]),
            ([-1, 0, 1], [1, 0, 1]),
        ],
    )
    def test_abs_nullable_int(self, any_signed_nullable_int_dtype, source, target):
        dtype = any_signed_nullable_int_dtype
        ser = Series(source, dtype=dtype)
        result = abs(ser)
        expected = Series(target, dtype=dtype)
        tm.assert_series_equal(result, expected)

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net