Skip to content

Commit 4ac8859

Browse files
committed
Reformat with black
1 parent 44a5819 commit 4ac8859

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

pandas/core/frame.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ def _constructor_expanddim(self):
390390
# ----------------------------------------------------------------------
391391
# Constructors
392392

393-
394393
def __init__(
395394
self,
396395
data=None,
@@ -452,8 +451,9 @@ def __init__(
452451
if is_list_like(data[0]) and getattr(data[0], "ndim", 1) == 1:
453452
if is_named_tuple(data[0]) and columns is None:
454453
columns = data[0]._fields
455-
arrays, columns = to_arrays(data, columns, dtype=dtype,
456-
to_integer_array=to_integer_array)
454+
arrays, columns = to_arrays(
455+
data, columns, dtype=dtype, to_integer_array=to_integer_array
456+
)
457457
columns = ensure_index(columns)
458458

459459
# set the index

pandas/core/internals/construction.py

+20-12
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,7 @@ def _get_axes(N, K, index, columns):
426426
# Conversion of Inputs to Arrays
427427

428428

429-
def to_arrays(data, columns, coerce_float=False, dtype=None,
430-
to_integer_array=False):
429+
def to_arrays(data, columns, coerce_float=False, dtype=None, to_integer_array=False):
431430
"""
432431
Return list of arrays, columns.
433432
"""
@@ -454,8 +453,11 @@ def to_arrays(data, columns, coerce_float=False, dtype=None,
454453
return _list_to_arrays(data, columns, coerce_float=coerce_float, dtype=dtype)
455454
elif isinstance(data[0], abc.Mapping):
456455
return _list_of_dict_to_arrays(
457-
data, columns, coerce_float=coerce_float, dtype=dtype,
458-
to_integer_array=to_integer_array
456+
data,
457+
columns,
458+
coerce_float=coerce_float,
459+
dtype=dtype,
460+
to_integer_array=to_integer_array,
459461
)
460462
elif isinstance(data[0], ABCSeries):
461463
return _list_of_series_to_arrays(
@@ -526,8 +528,9 @@ def _list_of_series_to_arrays(data, columns, coerce_float=False, dtype=None):
526528
return values.T, columns
527529

528530

529-
def _list_of_dict_to_arrays(data, columns, coerce_float=False, dtype=None,
530-
to_integer_array=False):
531+
def _list_of_dict_to_arrays(
532+
data, columns, coerce_float=False, dtype=None, to_integer_array=False
533+
):
531534
"""Convert list of dicts to numpy arrays
532535
533536
if `columns` is not passed, column names are inferred from the records
@@ -560,13 +563,17 @@ def _list_of_dict_to_arrays(data, columns, coerce_float=False, dtype=None,
560563

561564
content = list(lib.dicts_to_array(data, list(columns)).T)
562565
return _convert_object_array(
563-
content, columns, dtype=dtype, coerce_float=coerce_float,
564-
to_integer_array=to_integer_array
566+
content,
567+
columns,
568+
dtype=dtype,
569+
coerce_float=coerce_float,
570+
to_integer_array=to_integer_array,
565571
)
566572

567573

568-
def _convert_object_array(content, columns, coerce_float=False, dtype=None,
569-
to_integer_array=False):
574+
def _convert_object_array(
575+
content, columns, coerce_float=False, dtype=None, to_integer_array=False
576+
):
570577
if columns is None:
571578
columns = ibase.default_index(len(content))
572579
else:
@@ -580,8 +587,9 @@ def _convert_object_array(content, columns, coerce_float=False, dtype=None,
580587
# provide soft conversion of object dtypes
581588
def convert(arr):
582589
if dtype != object and dtype != np.object:
583-
arr = lib.maybe_convert_objects(arr, try_float=coerce_float,
584-
to_integer_array=to_integer_array)
590+
arr = lib.maybe_convert_objects(
591+
arr, try_float=coerce_float, to_integer_array=to_integer_array
592+
)
585593
arr = maybe_cast_to_datetime(arr, dtype)
586594
return arr
587595

pandas/io/json/_normalize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def json_normalize(
120120
errors: Optional[str] = "raise",
121121
sep: str = ".",
122122
max_level: Optional[int] = None,
123-
to_integer_array: Optional[bool] = False
123+
to_integer_array: Optional[bool] = False,
124124
):
125125
"""
126126
Normalize semi-structured JSON data into a flat table.

0 commit comments

Comments
 (0)