Skip to content

Commit eb03b45

Browse files
committed
drive by: put __all__ in alphabetical order
1 parent f12057f commit eb03b45

File tree

1 file changed

+37
-20
lines changed

1 file changed

+37
-20
lines changed

spec/API_specification/dataframe_api/__init__.py

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,33 @@
1414
from .typing import DType
1515

1616
__all__ = [
17-
"__dataframe_api_version__",
18-
"DataFrame",
19-
"Column",
20-
"column_from_sequence",
21-
"column_from_1d_array",
22-
"concat",
23-
"dataframe_from_dict",
24-
"dataframe_from_2d_array",
25-
"is_null",
26-
"null",
27-
"Int64",
28-
"Int32",
29-
"Int16",
30-
"Int8",
31-
"UInt64",
32-
"UInt32",
33-
"UInt16",
34-
"UInt8",
35-
"Float64",
36-
"Float32",
3717
"Bool",
18+
"Column",
19+
"DataFrame",
3820
"Date",
3921
"Datetime",
4022
"Duration",
23+
"Float32",
24+
"Float64",
25+
"Int16",
26+
"Int32",
27+
"Int64",
28+
"Int8",
4129
"String",
30+
"UInt16",
31+
"UInt32",
32+
"UInt64",
33+
"UInt8",
34+
"__dataframe_api_version__",
35+
"column_from_1d_array",
36+
"column_from_sequence",
37+
"concat",
38+
"dataframe_from_2d_array",
39+
"dataframe_from_dict",
40+
"date",
4241
"is_dtype",
42+
"is_null",
43+
"null",
4344
]
4445

4546

@@ -241,3 +242,19 @@ def is_dtype(dtype: DType, kind: str | tuple[str, ...]) -> bool:
241242
-------
242243
bool
243244
"""
245+
246+
def date(year: int, month: int, day: int) -> Any:
247+
"""
248+
Create date object which can be used for filtering.
249+
250+
Examples
251+
--------
252+
>>> df: DataFrame
253+
>>> namespace = df.__dataframe_namespace__()
254+
>>> mask = (
255+
... (df.get_column_by_name('date') >= namespace.date(2020, 1, 1))
256+
... (df.get_column_by_name('date') < namespace.date(2021, 1, 1))
257+
... )
258+
>>> df.filter(mask)
259+
"""
260+

0 commit comments

Comments
 (0)