HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/pandas/tests/frame/indexing/test_get.py
import pytest

from pandas import DataFrame
import pandas._testing as tm


class TestGet:
    def test_get(self, float_frame):
        b = float_frame.get("B")
        tm.assert_series_equal(b, float_frame["B"])

        assert float_frame.get("foo") is None
        tm.assert_series_equal(
            float_frame.get("foo", float_frame["B"]), float_frame["B"]
        )

    @pytest.mark.parametrize(
        "df",
        [
            DataFrame(),
            DataFrame(columns=list("AB")),
            DataFrame(columns=list("AB"), index=range(3)),
        ],
    )
    def test_get_none(self, df):
        # see gh-5652
        assert df.get(None) is None