|
18 | 18 | )
|
19 | 19 | del hard_dependencies, dependency, missing_dependencies
|
20 | 20 |
|
| 21 | +from pandas._config import ( |
| 22 | + describe_option, |
| 23 | + get_option, |
| 24 | + option_context, |
| 25 | + options, |
| 26 | + reset_option, |
| 27 | + set_option, |
| 28 | +) |
| 29 | + |
21 | 30 | # numpy compat
|
22 | 31 | from pandas.compat.numpy import (
|
| 32 | + _is_numpy_dev, |
23 | 33 | _np_version_under1p14,
|
24 | 34 | _np_version_under1p15,
|
25 | 35 | _np_version_under1p16,
|
26 | 36 | _np_version_under1p17,
|
27 | 37 | _np_version_under1p18,
|
28 |
| - _is_numpy_dev, |
29 | 38 | )
|
| 39 | +from pandas.util._print_versions import show_versions |
| 40 | +from pandas.util._tester import test |
30 | 41 |
|
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 |
50 | 43 |
|
51 | 44 | # 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 |
52 | 49 | 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 |
53 | 66 |
|
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, |
56 | 88 | Int8Dtype,
|
57 | 89 | Int16Dtype,
|
58 | 90 | Int32Dtype,
|
59 | 91 | 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, |
60 | 108 | UInt8Dtype,
|
61 | 109 | UInt16Dtype,
|
62 | 110 | UInt32Dtype,
|
63 | 111 | 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, |
72 | 118 | isna,
|
73 | 119 | isnull,
|
74 | 120 | notna,
|
75 | 121 | 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, |
92 | 122 | period_range,
|
93 |
| - Timedelta, |
| 123 | + set_eng_float_format, |
94 | 124 | timedelta_range,
|
95 |
| - Timestamp, |
96 |
| - date_range, |
97 |
| - bdate_range, |
98 |
| - Interval, |
99 |
| - interval_range, |
100 |
| - DateOffset, |
101 |
| - # conversion |
102 |
| - to_numeric, |
103 | 125 | to_datetime,
|
| 126 | + to_numeric, |
104 | 127 | to_timedelta,
|
105 |
| - # misc |
106 |
| - Grouper, |
107 |
| - factorize, |
108 | 128 | unique,
|
109 | 129 | value_counts,
|
110 |
| - NamedAgg, |
111 |
| - array, |
112 |
| - Categorical, |
113 |
| - set_eng_float_format, |
114 |
| - Series, |
115 |
| - DataFrame, |
116 | 130 | )
|
117 | 131 |
|
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 |
147 | 133 | ExcelFile,
|
148 | 134 | 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 |
158 | 135 | HDFStore,
|
159 |
| - read_hdf, |
160 |
| - # sql |
161 |
| - read_sql, |
162 |
| - read_sql_query, |
163 |
| - read_sql_table, |
164 |
| - # misc |
165 | 136 | read_clipboard,
|
166 |
| - read_parquet, |
167 |
| - read_orc, |
| 137 | + read_csv, |
| 138 | + read_excel, |
168 | 139 | read_feather,
|
| 140 | + read_fwf, |
169 | 141 | read_gbq,
|
| 142 | + read_hdf, |
170 | 143 | read_html,
|
171 | 144 | read_json,
|
172 |
| - read_stata, |
| 145 | + read_orc, |
| 146 | + read_parquet, |
| 147 | + read_pickle, |
173 | 148 | read_sas,
|
174 | 149 | read_spss,
|
| 150 | + read_sql, |
| 151 | + read_sql_query, |
| 152 | + read_sql_table, |
| 153 | + read_stata, |
| 154 | + read_table, |
| 155 | + to_pickle, |
175 | 156 | )
|
176 | 157 |
|
177 |
| -from pandas.io.json import _json_normalize as json_normalize |
178 | 158 |
|
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 |
182 | 169 |
|
183 |
| -# use the closest tagged version if possible |
184 |
| -from ._version import get_versions |
185 | 170 |
|
186 | 171 | v = get_versions()
|
187 | 172 | __version__ = v.get("closest-tag", v["version"])
|
|
0 commit comments