8000 pythonize cython code by jbrockmendel · Pull Request #22638 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

pythonize cython code #22638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 12, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add missing initialization
  • Loading branch information
jbrockmendel committed Sep 11, 2018
commit f9c0c269927f5bf4fea1b29a2ed02361b0ea5d67
3 changes: 2 additions & 1 deletion pandas/_libs/lib.pyx
6EF0
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ def values_from_object(object obj):

@cython.wraparound(False)
@cython.boundscheck(False)
def memory_usage_of_objects(object[:] arr):
def memory_usage_of_objects(arr: object[:]) -> int64_t:
""" return the memory usage of an object array in bytes,
does not include the actual bytes of the pointers """
i: Py_ssize_t
n: Py_ssize_t
size: int64_t

size = 0
n = len(arr)
for i in range(n):
size += arr[i].__sizeof__()
Expand Down
0