first commit

This commit is contained in:
Ayxan
2022-05-23 00:16:32 +04:00
commit d660f2a4ca
24786 changed files with 4428337 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
cdef class NDFrameIndexerBase:
"""
A base class for _NDFrameIndexer for fast instantiation and attribute access.
"""
cdef public:
str name
object obj, _ndim
def __init__(self, name: str, obj):
self.obj = obj
self.name = name
self._ndim = None
@property
def ndim(self) -> int:
# Delay `ndim` instantiation until required as reading it
# from `obj` isn't entirely cheap.
ndim = self._ndim
if ndim is None:
ndim = self._ndim = self.obj.ndim
if ndim > 2:
raise ValueError( # pragma: no cover
"NDFrameIndexer does not support NDFrame objects with ndim > 2"
)
return ndim