-
-
Notifications
You must be signed in to change notification settings - Fork 141
ENH: Improve Pandas scalars #383
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
Changes from 1 commit
5c0dc1c
9f5058f
7ad615a
fb6d782
fecd9f9
5adba7b
c4dca27
d86adfd
79f56c2
cc390f5
c044a8c
f58c47c
fbfa4c1
ccbde88
25aa8c9
290f951
e62cc10
9c6b963
e93ca54
9070b0d
28e127e
f59c689
2f262d4
7dd8c56
9c2d500
0c2f5ca
e224537
08156cc
1672751
4c3ea13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,17 @@ class IntervalArray(IntervalMixin, ExtensionArray): | |
cls, data, closed=..., dtype=..., copy: bool = ..., verify_integrity: bool = ... | ||
): ... | ||
@classmethod | ||
def from_breaks(cls, breaks, closed: str = ..., copy: bool = ..., dtype=...): ... | ||
def from_breaks( | ||
cls, breaks, closed: str = ..., copy: bool = ..., dtype=... | ||
) -> IntervalArray: ... | ||
@classmethod | ||
def from_arrays( | ||
cls, left, right, closed: str = ..., copy: bool = ..., dtype=... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
): ... | ||
) -> IntervalArray: ... | ||
@classmethod | ||
def from_tuples(cls, data, closed: str = ..., copy: bool = ..., dtype=...): ... | ||
def from_tuples( | ||
cls, data, closed: str = ..., copy: bool = ..., dtype=... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
) -> IntervalArray: ... | ||
def __iter__(self): ... | ||
def __len__(self) -> int: ... | ||
def __getitem__(self, value): ... | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ from pandas.core.arrays import ( | |
) | ||
from pandas.core.base import PandasObject | ||
|
||
from pandas._libs.sparse import SparseIndex | ||
|
||
class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin): | ||
def __init__( | ||
self, | ||
|
@@ -20,9 +22,9 @@ class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin): | |
def __array__(self, dtype=..., copy=...) -> np.ndarray: ... | ||
def __setitem__(self, key, value) -> None: ... | ||
@property | ||
def sp_index(self): ... | ||
def sp_index(self) -> SparseIndex: ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
@property | ||
def sp_values(self): ... | ||
def sp_values(self) -> np.ndarray: ... | ||
@property | ||
def dtype(self): ... | ||
@property | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ from pandas.core.dtypes.generic import ABCExtensionArray | |
|
||
def array( | ||
# str is forbidden even though Sequence[object] allows "abc" | ||
data: npt.NDArray | Sequence[object], | ||
data: npt.NDArray | Sequence[object] | pd.Index | pd.Series, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should use |
||
dtype: str | ||
| np.dtype[np.generic] | ||
| ExtensionDtype | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closed
should beIntervalClosedType