Skip to content

TYP: Replace wildcardimports in toplevelinit as precursor for reshape,stata,io PRs #25936 #25940 #25939 #26019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

40 changes: 34 additions & 6 deletions pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,42 @@
# let init-time option registration happen
import pandas.core.config_init

from pandas.core.api import *
from pandas.core.sparse.api import *
from pandas.tseries.api import *
from pandas.core.computation.api import *
from pandas.core.reshape.api import *
from pandas.core.api import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you organize these by section, e.g. something like

from pandas.core.api import (
    # dtype
    Int8Dtype.........

   # indexes
    Int64Index.....

  # tseries
   NaT, Period.....

  # conversion
   to_numeric, to_datetime...

  # missing
   isna, isnul.....

  # misc
  np, TimeGrouper....

Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, UInt8Dtype,
UInt16Dtype, UInt32Dtype, UInt64Dtype, factorize, unique,
value_counts, isna, isnull, notna, notnull, CategoricalDtype,
PeriodDtype, IntervalDtype, DatetimeTZDtype, Categorical,
array, Grouper, set_eng_float_format, Index, CategoricalIndex,
Int64Index, UInt64Index, RangeIndex, Float64Index, MultiIndex,
IntervalIndex, TimedeltaIndex, DatetimeIndex, PeriodIndex,
NaT, Period, period_range, Timedelta, timedelta_range,
Timestamp, date_range, bdate_range, Interval, interval_range,
Series, DataFrame, Panel, IndexSlice, to_numeric, DateOffset,
to_datetime, to_timedelta, np, TimeGrouper)

from pandas.core.sparse.api import (
SparseArray, SparseDataFrame, SparseSeries, SparseDtype)

from pandas.tseries.api import infer_freq
from pandas.tseries import offsets

from pandas.core.computation.api import eval

from pandas.core.reshape.api import (
concat, lreshape, melt, wide_to_long, merge, merge_asof,
merge_ordered, crosstab, pivot, pivot_table, get_dummies,
cut, qcut)

from pandas.util._print_versions import show_versions
from pandas.io.api import *

from pandas.io.api import (
read_clipboard, ExcelFile, ExcelWriter, read_excel,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you sort these

read_feather, read_gbq, read_html, read_json,
read_msgpack, to_msgpack, read_parquet, read_csv,
read_fwf, read_table, read_pickle, to_pickle,
HDFStore, read_hdf, read_sas, read_sql, read_sql_query,
read_sql_table, read_stata)

from pandas.util._tester import test
import pandas.testing
import pandas.arrays
Expand Down