Skip to content

Commit

Permalink
added test for perserving dtype when empty np.array used to make data…
Browse files Browse the repository at this point in the history
…frame
  • Loading branch information
tpackard1 committed Nov 22, 2023
1 parent e70e7de commit 6337387
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2758,6 +2758,13 @@ def test_frame_string_inference_block_dim(self):
df = DataFrame(np.array([["hello", "goodbye"], ["hello", "Hello"]]))
assert df._mgr.blocks[0].ndim == 2

def test_frame_from_empty_array_perserving_dtype(self):
# GH#55649
# start of simple
np_list = [np.int8, np.int16, np.uint16, np.uint64]
for n in np_list:
assert (np.array([], dtype=n).reshape((0, 0))).dtype == n


class TestDataFrameConstructorIndexInference:
def test_frame_from_dict_of_series_overlapping_monthly_period_indexes(self):
Expand Down

0 comments on commit 6337387

Please sign in to comment.