Skip to content

TST: Added test on dataframe constructor with None #52727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2639,6 +2639,12 @@ def test_construction_empty_array_multi_column_raises(self):
with pytest.raises(ValueError, match=msg):
DataFrame(data=np.array([]), columns=["a", "b"])

def test_construct_with_strings_and_none(self):
# GH#32218
df = DataFrame(["1", "2", None], columns=["a"], dtype="str")
expected = DataFrame({"a": ["1", "2", None]}, dtype="str")
tm.assert_frame_equal(df, expected)


class TestDataFrameConstructorIndexInference:
def test_frame_from_dict_of_series_overlapping_monthly_period_indexes(self):
Expand Down