本文整理匯總了Python中pandas._libs.lib.memory_usage_of_objects方法的典型用法代碼示例。如果您正苦於以下問題:Python lib.memory_usage_of_objects方法的具體用法?Python lib.memory_usage_of_objects怎麽用?Python lib.memory_usage_of_objects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pandas._libs.lib
的用法示例。
在下文中一共展示了lib.memory_usage_of_objects方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: memory_usage
# 需要導入模塊: from pandas._libs import lib [as 別名]
# 或者: from pandas._libs.lib import memory_usage_of_objects [as 別名]
def memory_usage(self, deep=False):
"""
Memory usage of the values
Parameters
----------
deep : bool
Introspect the data deeply, interrogate
`object` dtypes for system-level memory consumption
Returns
-------
bytes used
See Also
--------
numpy.ndarray.nbytes
Notes
-----
Memory usage does not include memory consumed by elements that
are not components of the array if deep=False or if used on PyPy
"""
if hasattr(self.array, 'memory_usage'):
return self.array.memory_usage(deep=deep)
v = self.array.nbytes
if deep and is_object_dtype(self) and not PYPY:
v += lib.memory_usage_of_objects(self.array)
return v
示例2: memory_usage
# 需要導入模塊: from pandas._libs import lib [as 別名]
# 或者: from pandas._libs.lib import memory_usage_of_objects [as 別名]
def memory_usage(self, deep=False):
values = self.sp_values
v = values.nbytes
if deep and is_object_dtype(self) and not PYPY:
v += lib.memory_usage_of_objects(values)
return v
示例3: memory_usage
# 需要導入模塊: from pandas._libs import lib [as 別名]
# 或者: from pandas._libs.lib import memory_usage_of_objects [as 別名]
def memory_usage(self, deep=False):
"""
Memory usage of the values
Parameters
----------
deep : bool
Introspect the data deeply, interrogate
`object` dtypes for system-level memory consumption
Returns
-------
bytes used
Notes
-----
Memory usage does not include memory consumed by elements that
are not components of the array if deep=False or if used on PyPy
See Also
--------
numpy.ndarray.nbytes
"""
if hasattr(self.values, 'memory_usage'):
return self.values.memory_usage(deep=deep)
v = self.values.nbytes
if deep and is_object_dtype(self) and not PYPY:
v += lib.memory_usage_of_objects(self.values)
return v
示例4: memory_usage
# 需要導入模塊: from pandas._libs import lib [as 別名]
# 或者: from pandas._libs.lib import memory_usage_of_objects [as 別名]
def memory_usage(self, deep=False):
"""
Memory usage of my values
Parameters
----------
deep : bool
Introspect the data deeply, interrogate
`object` dtypes for system-level memory consumption
Returns
-------
bytes used
Notes
-----
Memory usage does not include memory consumed by elements that
are not components of the array if deep=False or if used on PyPy
See Also
--------
numpy.ndarray.nbytes
"""
if hasattr(self.values, 'memory_usage'):
return self.values.memory_usage(deep=deep)
v = self.values.nbytes
if deep and is_object_dtype(self) and not PYPY:
v += lib.memory_usage_of_objects(self.values)
return v