Skip to content

Commit 9d66bdf

Browse files
ryankarlosjreback
authored andcommitted
Replace wildcardimports in toplevelinit as precursor for reshape,stata,io PRs pandas-dev#25936 pandas-dev#25940 pandas-dev#25939 (pandas-dev#26019)
1 parent 2f6b90a commit 9d66bdf

File tree

1 file changed

+67
-7
lines changed

1 file changed

+67
-7
lines changed

pandas/__init__.py

+67-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
del hard_dependencies, dependency, missing_dependencies
2121

2222
# numpy compat
23-
from pandas.compat.numpy import *
23+
from pandas.compat.numpy import (
24+
_np_version_under1p14, _np_version_under1p15, _np_version_under1p16,
25+
_np_version_under1p17)
2426

2527
try:
2628
from pandas._libs import (hashtable as _hashtable,
@@ -42,14 +44,72 @@
4244
# let init-time option registration happen
4345
import pandas.core.config_init
4446

45-
from pandas.core.api import *
46-
from pandas.core.sparse.api import *
47-
from pandas.tseries.api import *
48-
from pandas.core.computation.api import *
49-
from pandas.core.reshape.api import *
47+
from pandas.core.api import (
48+
# dtype
49+
Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, UInt8Dtype,
50+
UInt16Dtype, UInt32Dtype, UInt64Dtype, CategoricalDtype,
51+
PeriodDtype, IntervalDtype, DatetimeTZDtype,
52+
53+
# missing
54+
isna, isnull, notna, notnull,
55+
56+
# indexes
57+
Index, CategoricalIndex, Int64Index, UInt64Index, RangeIndex,
58+
Float64Index, MultiIndex, IntervalIndex, TimedeltaIndex,
59+
DatetimeIndex, PeriodIndex, IndexSlice,
60+
61+
# tseries
62+
NaT, Period, period_range, Timedelta, timedelta_range,
63+
Timestamp, date_range, bdate_range, Interval, interval_range,
64+
DateOffset,
65+
66+
# conversion
67+
to_numeric, to_datetime, to_timedelta,
68+
69+
# misc
70+
np, TimeGrouper, Grouper, factorize, unique, value_counts,
71+
array, Categorical, set_eng_float_format, Series, DataFrame,
72+
Panel)
73+
74+
from pandas.core.sparse.api import (
75+
SparseArray, SparseDataFrame, SparseSeries, SparseDtype)
76+
77+
from pandas.tseries.api import infer_freq
78+
from pandas.tseries import offsets
79+
80+
from pandas.core.computation.api import eval
81+
82+
from pandas.core.reshape.api import (
83+
concat, lreshape, melt, wide_to_long, merge, merge_asof,
84+
merge_ordered, crosstab, pivot, pivot_table, get_dummies,
85+
cut, qcut)
5086

5187
from pandas.util._print_versions import show_versions
52-
from pandas.io.api import *
88+
89+
from pandas.io.api import (
90+
# excel
91+
ExcelFile, ExcelWriter, read_excel,
92+
93+
# packers
94+
read_msgpack, to_msgpack,
95+
96+
# parsers
97+
read_csv, read_fwf, read_table,
98+
99+
# pickle
100+
read_pickle, to_pickle,
101+
102+
# pytables
103+
HDFStore, read_hdf,
104+
105+
# sql
106+
read_sql, read_sql_query,
107+
read_sql_table,
108+
109+
# misc
110+
read_clipboard, read_parquet, read_feather, read_gbq,
111+
read_html, read_json, read_stata, read_sas)
112+
53113
from pandas.util._tester import test
54114
import pandas.testing
55115
import pandas.arrays

0 commit comments

Comments
 (0)