def test_dataframe_data_types():
s1 = XSeries([pd.Series([1, 2, 3], index=['a', 'b', 'c']),
pd.Series([4, 5, 6], index=['d', 'e', 'g'])])
s2 = XSeries([1, 2, 3])
s3 = XSeries([{"k1": "v1"}, {"k2": 'v2'}])
s4 = XSeries(['f', 's', 't'])
df = XDataFrame({
'first_col': s1,
'second_col': s2,
'third_col': s3,
'fourth_col': s4
})
assert df['first_col'].data_type == pd.Series
assert df['second_col'].data_type == np.int64
assert df['third_col'].data_type == dict
assert df['fourth_col'].data_type == str
assert type(df[['first_col']]) == XDataFrame
assert type(df[['first_col', 'second_col']]) == XDataFrame
评论列表
文章目录