Detail: FrameGO: Dictionary-Like
Overview: FrameGO: Dictionary-Like
- FrameGO.__contains__(value)
Inclusion of value in column labels.
>>> f = sf.FrameGO.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x') >>> f <FrameGO: x> <IndexGO> a b c <<U1> <Index> 0 10 False 1517-01-01 1 2 True 1517-04-01 2 8 True 1517-12-31 3 3 False 1517-06-30 <int64> <int64> <bool> <datetime64[D]> >>> f.__contains__('a') True
- FrameGO.__iter__()
Iterator of column labels, same as
Frame.keys()
.>>> f = sf.FrameGO.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x') >>> f <FrameGO: x> <IndexGO> a b c <<U1> <Index> 0 10 False 1517-01-01 1 2 True 1517-04-01 2 8 True 1517-12-31 3 3 False 1517-06-30 <int64> <int64> <bool> <datetime64[D]> >>> tuple(f.__iter__()) ('a', 'b', 'c')
- FrameGO.__reversed__()
Returns a reverse iterator on the frame’s columns.
>>> f = sf.FrameGO.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x') >>> f <FrameGO: x> <IndexGO> a b c <<U1> <Index> 0 10 False 1517-01-01 1 2 True 1517-04-01 2 8 True 1517-12-31 3 3 False 1517-06-30 <int64> <int64> <bool> <datetime64[D]> >>> tuple(f.__reversed__()) ('c', 'b', 'a')
- FrameGO.get(key, default=None)
Return the value found at the columns key, else the default if the key is not found. This method is implemented to complete the dictionary-like interface.
>>> f = sf.FrameGO.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x') >>> f <FrameGO: x> <IndexGO> a b c <<U1> <Index> 0 10 False 1517-01-01 1 2 True 1517-04-01 2 8 True 1517-12-31 3 3 False 1517-06-30 <int64> <int64> <bool> <datetime64[D]> >>> f.get('a') <Series: a> <Index> 0 10 1 2 2 8 3 3 <int64> <int64> >>> f.get('z', -1) -1
- FrameGO.items()
Iterator of pairs of column label and corresponding column
Series
.>>> f = sf.FrameGO.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x') >>> f <FrameGO: x> <IndexGO> a b c <<U1> <Index> 0 10 False 1517-01-01 1 2 True 1517-04-01 2 8 True 1517-12-31 3 3 False 1517-06-30 <int64> <int64> <bool> <datetime64[D]> >>> tuple(f.items()) (('a', <Series: a> <Index> 0 10 1 2 2 8 3 3 <int64> <int64>), ('b', <Series: b> <Index> 0 False 1 True 2 True 3 False <int64> <bool>), ('c', <Series: c> <Index> 0 1517-01-01 1 1517-04-01 2 1517-12-31 3 1517-06-30 <int64> <datetime64[D]>))
- FrameGO.keys()
Iterator of column labels.
>>> f = sf.FrameGO.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x') >>> f <FrameGO: x> <IndexGO> a b c <<U1> <Index> 0 10 False 1517-01-01 1 2 True 1517-04-01 2 8 True 1517-12-31 3 3 False 1517-06-30 <int64> <int64> <bool> <datetime64[D]> >>> f.keys() <IndexGO> a b c <<U1>
- FrameGO.values
A 2D NumPy array of all values in the
Frame
. As this is a single array, heterogenous columnar types might be coerced to a compatible type.>>> f = sf.FrameGO.from_fields(((10, 2, 8, 3), (False, True, True, False), ('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30')), columns=('a', 'b', 'c'), dtypes=dict(c=np.datetime64), name='x') >>> f <FrameGO: x> <IndexGO> a b c <<U1> <Index> 0 10 False 1517-01-01 1 2 True 1517-04-01 2 8 True 1517-12-31 3 3 False 1517-06-30 <int64> <int64> <bool> <datetime64[D]> >>> f.values [[10 False datetime.date(1517, 1, 1)] [2 True datetime.date(1517, 4, 1)] [8 True datetime.date(1517, 12, 31)] [3 False datetime.date(1517, 6, 30)]]
FrameGO: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Assignment | Selector | Iterator | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Transpose | Accessor Fill Value | Accessor Regular Expression | Accessor Hashlib | Accessor Type Clinic | Accessor Reduce