Skip to content

Commit 26b8ad9

Browse files
author
MomIsBestFriend
committed
isort formatting
1 parent e0133b7 commit 26b8ad9

File tree

1 file changed

+102
-117
lines changed

1 file changed

+102
-117
lines changed

pandas/__init__.py

+102-117
Original file line numberDiff line numberDiff line change
@@ -18,170 +18,155 @@
1818
)
1919
del hard_dependencies, dependency, missing_dependencies
2020

21+
from pandas._config import (
22+
describe_option,
23+
get_option,
24+
option_context,
25+
options,
26+
reset_option,
27+
set_option,
28+
)
29+
2130
# numpy compat
2231
from pandas.compat.numpy import (
32+
_is_numpy_dev,
2333
_np_version_under1p14,
2434
_np_version_under1p15,
2535
_np_version_under1p16,
2636
_np_version_under1p17,
2737
_np_version_under1p18,
28-
_is_numpy_dev,
2938
)
39+
from pandas.util._print_versions import show_versions
40+
from pandas.util._tester import test
3041

31-
try:
32-
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
33-
except ImportError as e: # pragma: no cover
34-
# hack but overkill to use re
35-
module = str(e).replace("cannot import name ", "")
36-
raise ImportError(
37-
f"C extension: {module} not built. If you want to import "
38-
"pandas from the source directory, you may need to run "
39-
"'python setup.py build_ext --inplace --force' to build the C extensions first."
40-
) from e
41-
42-
from pandas._config import (
43-
get_option,
44-
set_option,
45-
reset_option,
46-
describe_option,
47-
option_context,
48-
options,
49-
)
42+
from pandas.core.dtypes.generic import ABCSparseArray
5043

5144
# let init-time option registration happen
45+
import pandas.api
46+
import pandas.arrays
47+
from pandas.core.arrays.sparse import SparseDtype
48+
from pandas.core.computation.api import eval
5249
import pandas.core.config_init
50+
from pandas.core.reshape.api import (
51+
concat,
52+
crosstab,
53+
cut,
54+
get_dummies,
55+
lreshape,
56+
melt,
57+
merge,
58+
merge_asof,
59+
merge_ordered,
60+
pivot,
61+
pivot_table,
62+
qcut,
63+
wide_to_long,
64+
)
65+
import pandas.testing
5366

54-
from pandas.core.api import (
55-
# dtype
67+
from pandas.io.json import _json_normalize as json_normalize
68+
from pandas.tseries import offsets
69+
from pandas.tseries.api import infer_freq
70+
71+
# use the closest tagged version if possible
72+
from ._version import get_versions
73+
74+
from pandas.core.api import ( # dtype; missing; indexes; tseries; conversion; misc
75+
NA,
76+
BooleanDtype,
77+
Categorical,
78+
CategoricalDtype,
79+
CategoricalIndex,
80+
DataFrame,
81+
DateOffset,
82+
DatetimeIndex,
83+
DatetimeTZDtype,
84+
Float64Index,
85+
Grouper,
86+
Index,
87+
IndexSlice,
5688
Int8Dtype,
5789
Int16Dtype,
5890
Int32Dtype,
5991
Int64Dtype,
92+
Int64Index,
93+
Interval,
94+
IntervalDtype,
95+
IntervalIndex,
96+
MultiIndex,
97+
NamedAgg,
98+
NaT,
99+
Period,
100+
PeriodDtype,
101+
PeriodIndex,
102+
RangeIndex,
103+
Series,
104+
StringDtype,
105+
Timedelta,
106+
TimedeltaIndex,
107+
Timestamp,
60108
UInt8Dtype,
61109
UInt16Dtype,
62110
UInt32Dtype,
63111
UInt64Dtype,
64-
CategoricalDtype,
65-
PeriodDtype,
66-
IntervalDtype,
67-
DatetimeTZDtype,
68-
StringDtype,
69-
BooleanDtype,
70-
# missing
71-
NA,
112+
UInt64Index,
113+
array,
114+
bdate_range,
115+
date_range,
116+
factorize,
117+
interval_range,
72118
isna,
73119
isnull,
74120
notna,
75121
notnull,
76-
# indexes
77-
Index,
78-
CategoricalIndex,
79-
Int64Index,
80-
UInt64Index,
81-
RangeIndex,
82-
Float64Index,
83-
MultiIndex,
84-
IntervalIndex,
85-
TimedeltaIndex,
86-
DatetimeIndex,
87-
PeriodIndex,
88-
IndexSlice,
89-
# tseries
90-
NaT,
91-
Period,
92122
period_range,
93-
Timedelta,
123+
set_eng_float_format,
94124
timedelta_range,
95-
Timestamp,
96-
date_range,
97-
bdate_range,
98-
Interval,
99-
interval_range,
100-
DateOffset,
101-
# conversion
102-
to_numeric,
103125
to_datetime,
126+
to_numeric,
104127
to_timedelta,
105-
# misc
106-
Grouper,
107-
factorize,
108128
unique,
109129
value_counts,
110-
NamedAgg,
111-
array,
112-
Categorical,
113-
set_eng_float_format,
114-
Series,
115-
DataFrame,
116130
)
117131

118-
from pandas.core.arrays.sparse import SparseDtype
119-
from pandas.core.dtypes.generic import ABCSparseArray
120-
121-
from pandas.tseries.api import infer_freq
122-
from pandas.tseries import offsets
123-
124-
from pandas.core.computation.api import eval
125-
126-
from pandas.core.reshape.api import (
127-
concat,
128-
lreshape,
129-
melt,
130-
wide_to_long,
131-
merge,
132-
merge_asof,
133-
merge_ordered,
134-
crosstab,
135-
pivot,
136-
pivot_table,
137-
get_dummies,
138-
cut,
139-
qcut,
140-
)
141-
142-
import pandas.api
143-
from pandas.util._print_versions import show_versions
144-
145-
from pandas.io.api import (
146-
# excel
132+
from pandas.io.api import ( # excel; parsers; pickle; pytables; sql; misc
147133
ExcelFile,
148134
ExcelWriter,
149-
read_excel,
150-
# parsers
151-
read_csv,
152-
read_fwf,
153-
read_table,
154-
# pickle
155-
read_pickle,
156-
to_pickle,
157-
# pytables
158135
HDFStore,
159-
read_hdf,
160-
# sql
161-
read_sql,
162-
read_sql_query,
163-
read_sql_table,
164-
# misc
165136
read_clipboard,
166-
read_parquet,
167-
read_orc,
137+
read_csv,
138+
read_excel,
168139
read_feather,
140+
read_fwf,
169141
read_gbq,
142+
read_hdf,
170143
read_html,
171144
read_json,
172-
read_stata,
145+
read_orc,
146+
read_parquet,
147+
read_pickle,
173148
read_sas,
174149
read_spss,
150+
read_sql,
151+
read_sql_query,
152+
read_sql_table,
153+
read_stata,
154+
read_table,
155+
to_pickle,
175156
)
176157

177-
from pandas.io.json import _json_normalize as json_normalize
178158

179-
from pandas.util._tester import test
180-
import pandas.testing
181-
import pandas.arrays
159+
try:
160+
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
161+
except ImportError as e: # pragma: no cover
162+
# hack but overkill to use re
163+
module = str(e).replace("cannot import name ", "")
164+
raise ImportError(
165+
f"C extension: {module} not built. If you want to import "
166+
"pandas from the source directory, you may need to run "
167+
"'python setup.py build_ext --inplace --force' to build the C extensions first."
168+
) from e
182169

183-
# use the closest tagged version if possible
184-
from ._version import get_versions
185170

186171
v = get_versions()
187172
__version__ = v.get("closest-tag", v["version"])

0 commit comments

Comments
 (0)