Skip to content

Commit d9a2b4b

Browse files
blacken
1 parent e59cd0a commit d9a2b4b

File tree

691 files changed

+121967
-93913
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

691 files changed

+121967
-93913
lines changed

pandas/__init__.py

Lines changed: 134 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# flake8: noqa
22

3-
__docformat__ = 'restructuredtext'
3+
__docformat__ = "restructuredtext"
44

55
# Let users know if they're missing any of our hard dependencies
66
hard_dependencies = ("numpy", "pytz", "dateutil")
@@ -13,130 +13,209 @@
1313
missing_dependencies.append("{0}: {1}".format(dependency, str(e)))
1414

1515
if missing_dependencies:
16-
raise ImportError("Unable to import required dependencies:\n" + "\n".join(missing_dependencies))
16+
raise ImportError(
17+
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
18+
)
1719
del hard_dependencies, dependency, missing_dependencies
1820

1921
# numpy compat
2022
from pandas.compat.numpy import (
21-
_np_version_under1p14, _np_version_under1p15, _np_version_under1p16,
22-
_np_version_under1p17)
23+
_np_version_under1p14,
24+
_np_version_under1p15,
25+
_np_version_under1p16,
26+
_np_version_under1p17,
27+
)
2328

2429
try:
25-
from pandas._libs import (hashtable as _hashtable,
26-
lib as _lib,
27-
tslib as _tslib)
30+
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
2831
except ImportError as e: # pragma: no cover
2932
# hack but overkill to use re
30-
module = str(e).replace('cannot import name ', '')
31-
raise ImportError("C extension: {0} not built. If you want to import "
32-
"pandas from the source directory, you may need to run "
33-
"'python setup.py build_ext --inplace --force' to build "
34-
"the C extensions first.".format(module))
33+
module = str(e).replace("cannot import name ", "")
34+
raise ImportError(
35+
"C extension: {0} not built. If you want to import "
36+
"pandas from the source directory, you may need to run "
37+
"'python setup.py build_ext --inplace --force' to build "
38+
"the C extensions first.".format(module)
39+
)
3540

3641
from datetime import datetime
3742

38-
from pandas._config import (get_option, set_option, reset_option,
39-
describe_option, option_context, options)
43+
from pandas._config import (
44+
get_option,
45+
set_option,
46+
reset_option,
47+
describe_option,
48+
option_context,
49+
options,
50+
)
4051

4152
# let init-time option registration happen
4253
import pandas.core.config_init
4354

4455
from pandas.core.api import (
4556
# dtype
46-
Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, UInt8Dtype,
47-
UInt16Dtype, UInt32Dtype, UInt64Dtype, CategoricalDtype,
48-
PeriodDtype, IntervalDtype, DatetimeTZDtype,
49-
57+
Int8Dtype,
58+
Int16Dtype,
59+
Int32Dtype,
60+
Int64Dtype,
61+
UInt8Dtype,
62+
UInt16Dtype,
63+
UInt32Dtype,
64+
UInt64Dtype,
65+
CategoricalDtype,
66+
PeriodDtype,
67+
IntervalDtype,
68+
DatetimeTZDtype,
5069
# missing
51-
isna, isnull, notna, notnull,
52-
70+
isna,
71+
isnull,
72+
notna,
73+
notnull,
5374
# indexes
54-
Index, CategoricalIndex, Int64Index, UInt64Index, RangeIndex,
55-
Float64Index, MultiIndex, IntervalIndex, TimedeltaIndex,
56-
DatetimeIndex, PeriodIndex, IndexSlice,
57-
75+
Index,
76+
CategoricalIndex,
77+
Int64Index,
78+
UInt64Index,
79+
RangeIndex,
80+
Float64Index,
81+
MultiIndex,
82+
IntervalIndex,
83+
TimedeltaIndex,
84+
DatetimeIndex,
85+
PeriodIndex,
86+
IndexSlice,
5887
# tseries
59-
NaT, Period, period_range, Timedelta, timedelta_range,
60-
Timestamp, date_range, bdate_range, Interval, interval_range,
88+
NaT,
89+
Period,
90+
period_range,
91+
Timedelta,
92+
timedelta_range,
93+
Timestamp,
94+
date_range,
95+
bdate_range,
96+
Interval,
97+
interval_range,
6198
DateOffset,
62-
6399
# conversion
64-
to_numeric, to_datetime, to_timedelta,
65-
100+
to_numeric,
101+
to_datetime,
102+
to_timedelta,
66103
# misc
67-
np, Grouper, factorize, unique, value_counts, NamedAgg,
68-
array, Categorical, set_eng_float_format, Series, DataFrame)
104+
np,
105+
Grouper,
106+
factorize,
107+
unique,
108+
value_counts,
109+
NamedAgg,
110+
array,
111+
Categorical,
112+
set_eng_float_format,
113+
Series,
114+
DataFrame,
115+
)
69116

70117
from pandas.core.sparse.api import (
71-
SparseArray, SparseDataFrame, SparseSeries, SparseDtype)
118+
SparseArray,
119+
SparseDataFrame,
120+
SparseSeries,
121+
SparseDtype,
122+
)
72123

73124
from pandas.tseries.api import infer_freq
74125
from pandas.tseries import offsets
75126

76127
from pandas.core.computation.api import eval
77128

78129
from pandas.core.reshape.api import (
79-
concat, lreshape, melt, wide_to_long, merge, merge_asof,
80-
merge_ordered, crosstab, pivot, pivot_table, get_dummies,
81-
cut, qcut)
130+
concat,
131+
lreshape,
132+
melt,
133+
wide_to_long,
134+
merge,
135+
merge_asof,
136+
merge_ordered,
137+
crosstab,
138+
pivot,
139+
pivot_table,
140+
get_dummies,
141+
cut,
142+
qcut,
143+
)
82144

83145
from pandas.util._print_versions import show_versions
84146

85147
from pandas.io.api import (
86148
# excel
87-
ExcelFile, ExcelWriter, read_excel,
88-
149+
ExcelFile,
150+
ExcelWriter,
151+
read_excel,
89152
# packers
90-
read_msgpack, to_msgpack,
91-
153+
read_msgpack,
154+
to_msgpack,
92155
# parsers
93-
read_csv, read_fwf, read_table,
94-
156+
read_csv,
157+
read_fwf,
158+
read_table,
95159
# pickle
96-
read_pickle, to_pickle,
97-
160+
read_pickle,
161+
to_pickle,
98162
# pytables
99-
HDFStore, read_hdf,
100-
163+
HDFStore,
164+
read_hdf,
101165
# sql
102-
read_sql, read_sql_query,
166+
read_sql,
167+
read_sql_query,
103168
read_sql_table,
104-
105169
# misc
106-
read_clipboard, read_parquet, read_feather, read_gbq,
107-
read_html, read_json, read_stata, read_sas, read_spss)
170+
read_clipboard,
171+
read_parquet,
172+
read_feather,
173+
read_gbq,
174+
read_html,
175+
read_json,
176+
read_stata,
177+
read_sas,
178+
read_spss,
179+
)
108180

109181
from pandas.util._tester import test
110182
import pandas.testing
111183
import pandas.arrays
112184

113185
# use the closest tagged version if possible
114186
from ._version import get_versions
187+
115188
v = get_versions()
116-
__version__ = v.get('closest-tag', v['version'])
117-
__git_version__ = v.get('full-revisionid')
189+
__version__ = v.get("closest-tag", v["version"])
190+
__git_version__ = v.get("full-revisionid")
118191
del get_versions, v
119192

120193

121194
# GH 27101
122195
# TODO: remove Panel compat in 1.0
123196
if pandas.compat.PY37:
197+
124198
def __getattr__(name):
125-
if name == 'Panel':
199+
if name == "Panel":
126200
import warnings
201+
127202
warnings.warn(
128203
"The Panel class is removed from pandas. Accessing it "
129204
"from the top-level namespace will also be removed in "
130205
"the next version",
131-
FutureWarning, stacklevel=2)
206+
FutureWarning,
207+
stacklevel=2,
208+
)
132209

133210
class Panel:
134211
pass
135212

136213
return Panel
137-
raise AttributeError(
138-
"module 'pandas' has no attribute '{}'".format(name))
214+
raise AttributeError("module 'pandas' has no attribute '{}'".format(name))
215+
216+
139217
else:
218+
140219
class Panel:
141220
pass
142221

pandas/_config/__init__.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,24 @@
55
importing `dates` and `display` ensures that keys needed by _libs
66
are initialized.
77
"""
8-
__all__ = ["config", "detect_console_encoding", "get_option", "set_option",
9-
"reset_option", "describe_option", "option_context", "options"]
8+
__all__ = [
9+
"config",
10+
"detect_console_encoding",
11+
"get_option",
12+
"set_option",
13+
"reset_option",
14+
"describe_option",
15+
"option_context",
16+
"options",
17+
]
1018
from pandas._config import config
1119
from pandas._config import dates # noqa:F401
1220
from pandas._config.config import (
13-
describe_option, get_option, option_context, options, reset_option,
14-
set_option)
21+
describe_option,
22+
get_option,
23+
option_context,
24+
options,
25+
reset_option,
26+
set_option,
27+
)
1528
from pandas._config.display import detect_console_encoding

0 commit comments

Comments
 (0)