Detail: MemoryDisplay: Constructor
Overview: MemoryDisplay: Constructor
- MemoryDisplay.__init__(frame)[source]
Initialize an instance with a
Frame
of byte counts.>>> f = sf.Frame.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 <Frame: x> <Index> 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.memory L Lu LM LMu LMD LMDu R Ru RM RMu RMD RMDu Name 50 B 50 B 50 B 50 B 50 B 50 B Index 236 B 252 B 124 B 8.34 KB 284 B 156 B Columns 800 B 832 B 576 B 8.89 KB 856 B 600 B Blocks 748 B 796 B 412 B 748 B 796 B 412 B Total 1.82 KB 1.91 KB 1.16 KB 9.93 KB 1.97 KB 1.22 KB
- classmethod MemoryDisplay.from_any(obj, label_component_pairs=())[source]
Given any slotted object, return a
MemoryDisplay
instance.>>> f = sf.Frame.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 <Frame: x> <Index> 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]> >>> sf.MemoryDisplay.from_any(f.index) L Lu LM LMu LMD LMDu R Ru RM RMu RMD RMDu Total 236 B 252 B 124 B 8.34 KB 284 B 156 B