403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/pandas/tests/frame/methods/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/pandas/tests/frame/methods/test_swapaxes.py
import numpy as np
import pytest

from pandas import DataFrame
import pandas._testing as tm


class TestSwapAxes:
    def test_swapaxes(self):
        df = DataFrame(np.random.default_rng(2).standard_normal((10, 5)))
        msg = "'DataFrame.swapaxes' is deprecated"
        with tm.assert_produces_warning(FutureWarning, match=msg):
            tm.assert_frame_equal(df.T, df.swapaxes(0, 1))
            tm.assert_frame_equal(df.T, df.swapaxes(1, 0))

    def test_swapaxes_noop(self):
        df = DataFrame(np.random.default_rng(2).standard_normal((10, 5)))
        msg = "'DataFrame.swapaxes' is deprecated"
        with tm.assert_produces_warning(FutureWarning, match=msg):
            tm.assert_frame_equal(df, df.swapaxes(0, 0))

    def test_swapaxes_invalid_axis(self):
        df = DataFrame(np.random.default_rng(2).standard_normal((10, 5)))
        msg = "'DataFrame.swapaxes' is deprecated"
        with tm.assert_produces_warning(FutureWarning, match=msg):
            msg = "No axis named 2 for object type DataFrame"
            with pytest.raises(ValueError, match=msg):
                df.swapaxes(2, 5)

    def test_round_empty_not_input(self):
        # GH#51032
        df = DataFrame({"a": [1, 2]})
        msg = "'DataFrame.swapaxes' is deprecated"
        with tm.assert_produces_warning(FutureWarning, match=msg):
            result = df.swapaxes("index", "index")
        tm.assert_frame_equal(df, result)
        assert df is not result

Youez - 2016 - github.com/yon3zu
LinuXploit