Detail: MemoryDisplay: Constructor#
Overview: MemoryDisplay: Constructor
- MemoryDisplay.__init__(frame)[source]#
Initialize an instance with a
Frameof 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 42 B 42 B 42 B 42 B 42 B 42 B Index 292 B 308 B 180 B 8.39 KB 340 B 212 B Columns 856 B 888 B 632 B 8.95 KB 912 B 656 B Blocks 748 B 796 B 412 B 748 B 796 B 412 B Total 1.93 KB 2.02 KB 1.27 KB 10.04 KB 2.08 KB 1.33 KB
- classmethod MemoryDisplay.from_any(obj, label_component_pairs=())[source]#
Given any slotted object, return a
MemoryDisplayinstance.>>> 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 292 B 308 B 180 B 8.39 KB 340 B 212 B