Exemplo n.º 1
0
 def sparse_series_date(self):
     arr, index = self.create_numpy_data_nan()
     date_index = pandas.bdate_range("1/1/2011", periods=len(index))
     return pandas.SparseSeries(arr,
                                index=date_index,
                                kind="block",
                                name="bseries")
Exemplo n.º 2
0
 def sparse_series_dict(self):
     d = OrderedDict()
     d["b"] = 1
     d["a"] = 0
     d["c"] = 2
     return pandas.SparseSeries(d)
Exemplo n.º 3
0
 def sparse_series_dict_indexed(self):
     constructor_dict = {1: 1.0}
     index = [0, 1, 2]
     # Series with index passed in
     series = pandas.Series(constructor_dict)
     return pandas.SparseSeries(series, index=index)
Exemplo n.º 4
0
 def sparse_series_dict(self):
     d = OrderedDict()
     d['b'] = 1
     d['a'] = 0
     d['c'] = 2
     return pandas.SparseSeries(d)