Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from all commits
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
32 changes: 24 additions & 8 deletions fletcher/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,29 @@ def __array__(self, copy=None):
"""
return pa.column("dummy", self.data).to_pandas().values

@property
def size(self):
"""
Number of elements in this array.

Returns
-------
size : int
"""
# type: () -> int
return len(self.data)

@property
def shape(self):
# type: () -> Tuple[int]
# This may be patched by pandas to support pseudo-2D operations.
return (self.size,)

@property
def ndim(self):
# type: () -> int
return len(self.shape)

def __len__(self):
"""
Length of this array
Expand All @@ -214,7 +237,7 @@ def __len__(self):
length : int
"""
# type: () -> int
return len(self.data)
return self.shape[0]

@classmethod
def _concat_same_type(cls, to_concat):
Expand Down Expand Up @@ -481,13 +504,6 @@ def nbytes(self):
size += buf.size
return size

@property
def size(self):
"""
return the number of elements in the underlying data
"""
return len(self.data)

@property
def base(self):
"""
Expand Down