Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 89 additions & 92 deletions pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
missing_dependencies.append(f"{dependency}: {e}")

if missing_dependencies:
raise ImportError(
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
)
raise ImportError("Unable to import required dependencies:\n" +
"\n".join(missing_dependencies))
del hard_dependencies, dependency, missing_dependencies

# numpy compat
from pandas.compat import is_numpy_dev as _is_numpy_dev

try:
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
from pandas._libs import (
hashtable as _hashtable,
lib as _lib,
tslib as _tslib,
)
except ImportError as err: # pragma: no cover
module = err.name
raise ImportError(
Expand All @@ -34,143 +37,133 @@
del _tslib, _lib, _hashtable

from pandas._config import (
get_option,
set_option,
reset_option,
describe_option,
get_option,
option_context,
options,
reset_option,
set_option,
)

from pandas.core.api import (
# dtype
from pandas.util._print_versions import show_versions
from pandas.util._tester import test

from pandas import (
api,
arrays,
errors,
io,
plotting,
testing,
tseries,
)

# use the closest tagged version if possible
from pandas._version import get_versions
from pandas.core.api import ( # dtype; missing; indexes; tseries; conversion; misc
NA,
BooleanDtype,
Categorical,
CategoricalDtype,
CategoricalIndex,
DataFrame,
DateOffset,
DatetimeIndex,
DatetimeTZDtype,
Flags,
Float32Dtype,
Float64Dtype,
Grouper,
Index,
IndexSlice,
Int8Dtype,
Int16Dtype,
Int32Dtype,
Int64Dtype,
Interval,
IntervalDtype,
IntervalIndex,
MultiIndex,
NamedAgg,
NaT,
Period,
PeriodDtype,
PeriodIndex,
RangeIndex,
Series,
StringDtype,
Timedelta,
TimedeltaIndex,
Timestamp,
UInt8Dtype,
UInt16Dtype,
UInt32Dtype,
UInt64Dtype,
Float32Dtype,
Float64Dtype,
CategoricalDtype,
PeriodDtype,
IntervalDtype,
DatetimeTZDtype,
StringDtype,
BooleanDtype,
# missing
NA,
array,
bdate_range,
date_range,
factorize,
interval_range,
isna,
isnull,
notna,
notnull,
# indexes
Index,
CategoricalIndex,
RangeIndex,
MultiIndex,
IntervalIndex,
TimedeltaIndex,
DatetimeIndex,
PeriodIndex,
IndexSlice,
# tseries
NaT,
Period,
period_range,
Timedelta,
set_eng_float_format,
timedelta_range,
Timestamp,
date_range,
bdate_range,
Interval,
interval_range,
DateOffset,
# conversion
to_numeric,
to_datetime,
to_numeric,
to_timedelta,
# misc
Flags,
Grouper,
factorize,
unique,
value_counts,
NamedAgg,
array,
Categorical,
set_eng_float_format,
Series,
DataFrame,
)

from pandas.core.arrays.sparse import 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,
crosstab,
cut,
get_dummies,
lreshape,
melt,
wide_to_long,
merge,
merge_asof,
merge_ordered,
crosstab,
pivot,
pivot_table,
get_dummies,
cut,
qcut,
wide_to_long,
)

from pandas import api, arrays, errors, io, plotting, testing, tseries
from pandas.util._print_versions import show_versions

from pandas.io.api import (
# excel
from pandas.io.api import ( # excel; parsers; pickle; pytables; sql; misc
ExcelFile,
ExcelWriter,
read_excel,
# parsers
read_csv,
read_fwf,
read_table,
# pickle
read_pickle,
to_pickle,
# pytables
HDFStore,
read_hdf,
# sql
read_sql,
read_sql_query,
read_sql_table,
# misc
read_clipboard,
read_parquet,
read_orc,
read_csv,
read_excel,
read_feather,
read_fwf,
read_gbq,
read_hdf,
read_html,
read_xml,
read_json,
read_stata,
read_orc,
read_parquet,
read_pickle,
read_sas,
read_spss,
read_sql,
read_sql_query,
read_sql_table,
read_stata,
read_table,
read_xml,
to_pickle,
)

from pandas.io.json import _json_normalize as json_normalize

from pandas.util._tester import test

# use the closest tagged version if possible
from pandas._version import get_versions
from pandas.tseries import offsets
from pandas.tseries.api import infer_freq

v = get_versions()
__version__ = v.get("closest-tag", v["version"])
Expand Down Expand Up @@ -199,7 +192,11 @@ def __getattr__(name):
FutureWarning,
stacklevel=2,
)
from pandas.core.api import Float64Index, Int64Index, UInt64Index
from pandas.core.api import (
Float64Index,
Int64Index,
UInt64Index,
)

return {
"Float64Index": Float64Index,
Expand Down
Loading