def __init__(self, *args, **kwargs):
'''
The same arguments as for pandas.Series
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.html
In order to create XSeries of any data_type, data argument must be a pythons list.
For example, to create XSeries of pandas.Series, pass data should be
data = [s_1, s2, ..., s3] where s_i is a instance of pandas.Series.
'''
super(XSeries, self).__init__(*args, **kwargs)
data = kwargs.get('data')
if data is None:
data = args[0]
check_result, data_type = _check_all_elements_have_the_same_property(data, type)
if not check_result:
raise ValueError('Not all elements the same type')
if data_type is not None:
self._data_type = data_type
else:
self._data_type = type(data._values[0])
评论列表
文章目录