Skip to content

Commit 2b3afa5

Browse files
committed
Sorting imports into catgeories and importing pandas.compat.numpy objects
1 parent e50469d commit 2b3afa5

File tree

1 file changed

+47
-15
lines changed

1 file changed

+47
-15
lines changed

pandas/__init__.py

+47-15
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+
LooseVersion, tz_replacer, _tz_regex, np_datetime64_compat,
25+
np_array_datetime64_compat, function)
2426

2527
try:
2628
from pandas._libs import (hashtable as _hashtable,
@@ -43,17 +45,31 @@
4345
import pandas.core.config_init
4446

4547
from pandas.core.api import (
48+
#dtype
4649
Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, UInt8Dtype,
47-
UInt16Dtype, UInt32Dtype, UInt64Dtype, factorize, unique,
48-
value_counts, isna, isnull, notna, notnull, CategoricalDtype,
49-
PeriodDtype, IntervalDtype, DatetimeTZDtype, Categorical,
50-
array, Grouper, set_eng_float_format, Index, CategoricalIndex,
51-
Int64Index, UInt64Index, RangeIndex, Float64Index, MultiIndex,
52-
IntervalIndex, TimedeltaIndex, DatetimeIndex, PeriodIndex,
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
5362
NaT, Period, period_range, Timedelta, timedelta_range,
5463
Timestamp, date_range, bdate_range, Interval, interval_range,
55-
Series, DataFrame, Panel, IndexSlice, to_numeric, DateOffset,
56-
to_datetime, to_timedelta, np, TimeGrouper)
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)
5773

5874
from pandas.core.sparse.api import (
5975
SparseArray, SparseDataFrame, SparseSeries, SparseDtype)
@@ -71,12 +87,28 @@
7187
from pandas.util._print_versions import show_versions
7288

7389
from pandas.io.api import (
74-
read_clipboard, ExcelFile, ExcelWriter, read_excel,
75-
read_feather, read_gbq, read_html, read_json,
76-
read_msgpack, to_msgpack, read_parquet, read_csv,
77-
read_fwf, read_table, read_pickle, to_pickle,
78-
HDFStore, read_hdf, read_sas, read_sql, read_sql_query,
79-
read_sql_table, read_stata)
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)
80112

81113
from pandas.util._tester import test
82114
import pandas.testing

0 commit comments

Comments
 (0)