6
6
from typing import Mapping , Sequence , Any
7
7
8
8
from .column_object import *
9
- from .dataframe_object import *
9
+ from .dataframe_object import DataFrame
10
10
from .groupby_object import *
11
-
11
+ from . _types import DType
12
12
13
13
__all__ = [
14
- "__dataframe_api_version" ,
14
+ "__dataframe_api_version__" ,
15
+ "DataFrame" ,
16
+ "Column" ,
15
17
"column_from_sequence" ,
16
18
"concat" ,
17
19
"dataframe_from_dict" ,
18
20
"is_null" ,
19
21
"null" ,
20
- "DType" ,
21
22
"Int64" ,
22
23
"Int32" ,
23
24
"Int16" ,
@@ -59,7 +60,7 @@ def concat(dataframes: Sequence[DataFrame]) -> DataFrame:
59
60
"""
60
61
...
61
62
62
- def column_from_sequence (sequence : Sequence [object ], * , dtype : DType ) -> Column :
63
+ def column_from_sequence (sequence : Sequence [Any ], * , dtype : Any ) -> Column [ Any ] :
63
64
"""
64
65
Construct Column from sequence of elements.
65
66
@@ -78,7 +79,7 @@ def column_from_sequence(sequence: Sequence[object], *, dtype: DType) -> Column:
78
79
"""
79
80
...
80
81
81
- def dataframe_from_dict (data : Mapping [str , Column ]) -> DataFrame :
82
+ def dataframe_from_dict (data : Mapping [str , Column [ Any ] ]) -> DataFrame :
82
83
"""
83
84
Construct DataFrame from map of column names to Columns.
84
85
@@ -144,38 +145,35 @@ def is_null(value: object, /) -> bool:
144
145
# Dtypes #
145
146
##########
146
147
147
- class DType :
148
- """Base class for all dtypes."""
149
-
150
- class Int64 (DType ):
148
+ class Int64 :
151
149
"""Integer type with 64 bits of precision."""
152
150
153
- class Int32 ( DType ) :
151
+ class Int32 :
154
152
"""Integer type with 32 bits of precision."""
155
153
156
- class Int16 ( DType ) :
154
+ class Int16 :
157
155
"""Integer type with 16 bits of precision."""
158
156
159
- class Int8 ( DType ) :
157
+ class Int8 :
160
158
"""Integer type with 8 bits of precision."""
161
159
162
- class UInt64 ( DType ) :
160
+ class UInt64 :
163
161
"""Unsigned integer type with 64 bits of precision."""
164
162
165
- class UInt32 ( DType ) :
163
+ class UInt32 :
166
164
"""Unsigned integer type with 32 bits of precision."""
167
165
168
- class UInt16 ( DType ) :
166
+ class UInt16 :
169
167
"""Unsigned integer type with 16 bits of precision."""
170
168
171
- class UInt8 ( DType ) :
169
+ class UInt8 :
172
170
"""Unsigned integer type with 8 bits of precision."""
173
171
174
- class Float64 ( DType ) :
172
+ class Float64 :
175
173
"""Floating point type with 64 bits of precision."""
176
174
177
- class Float32 ( DType ) :
175
+ class Float32 :
178
176
"""Floating point type with 32 bits of precision."""
179
177
180
- class Bool ( DType ) :
178
+ class Bool :
181
179
"""Boolean type with 8 bits of precision."""
0 commit comments