Skip to content

Commit 795a070

Browse files
blacken
1 parent 1452e71 commit 795a070

File tree

689 files changed

+121272
-93220
lines changed

Some content is hidden

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

689 files changed

+121272
-93220
lines changed

pandas/__init__.py

+125-52
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,109 +13,182 @@
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,
69-
Panel)
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+
Panel,
116+
)
70117

71118
from pandas.core.sparse.api import (
72-
SparseArray, SparseDataFrame, SparseSeries, SparseDtype)
119+
SparseArray,
120+
SparseDataFrame,
121+
SparseSeries,
122+
SparseDtype,
123+
)
73124

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

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

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

84146
from pandas.util._print_versions import show_versions
85147

86148
from pandas.io.api import (
87149
# excel
88-
ExcelFile, ExcelWriter, read_excel,
89-
150+
ExcelFile,
151+
ExcelWriter,
152+
read_excel,
90153
# packers
91-
read_msgpack, to_msgpack,
92-
154+
read_msgpack,
155+
to_msgpack,
93156
# parsers
94-
read_csv, read_fwf, read_table,
95-
157+
read_csv,
158+
read_fwf,
159+
read_table,
96160
# pickle
97-
read_pickle, to_pickle,
98-
161+
read_pickle,
162+
to_pickle,
99163
# pytables
100-
HDFStore, read_hdf,
101-
164+
HDFStore,
165+
read_hdf,
102166
# sql
103-
read_sql, read_sql_query,
167+
read_sql,
168+
read_sql_query,
104169
read_sql_table,
105-
106170
# misc
107-
read_clipboard, read_parquet, read_feather, read_gbq,
108-
read_html, read_json, read_stata, read_sas, read_spss)
171+
read_clipboard,
172+
read_parquet,
173+
read_feather,
174+
read_gbq,
175+
read_html,
176+
read_json,
177+
read_stata,
178+
read_sas,
179+
read_spss,
180+
)
109181

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

114186
# use the closest tagged version if possible
115187
from ._version import get_versions
188+
116189
v = get_versions()
117-
__version__ = v.get('closest-tag', v['version'])
118-
__git_version__ = v.get('full-revisionid')
190+
__version__ = v.get("closest-tag", v["version"])
191+
__git_version__ = v.get("full-revisionid")
119192
del get_versions, v
120193

121194
# module level doc-string

pandas/_config/__init__.py

+17-4
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)