Skip to content

Commit f47b60f

Browse files
committed
Reformat with black
1 parent 475ed6d commit f47b60f

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

pandas/core/frame.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,9 @@ def __init__(
461461
if is_list_like(data[0]) and getattr(data[0], "ndim", 1) == 1:
462462
if is_named_tuple(data[0]) and columns is None:
463463
columns = data[0]._fields
464-
arrays, columns = to_arrays(data, columns, dtype=dtype,
465-
to_integer_array=to_integer_array)
464+
arrays, columns = to_arrays(
465+
data, columns, dtype=dtype, to_integer_array=to_integer_array
466+
)
466467
columns = ensure_index(columns)
467468

468469
# set the index

pandas/core/internals/construction.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,7 @@ def _get_axes(N, K, index, columns):
429429
# Conversion of Inputs to Arrays
430430

431431

432-
def to_arrays(data, columns, coerce_float=False, dtype=None,
433-
to_integer_array=False):
432+
def to_arrays(data, columns, coerce_float=False, dtype=None, to_integer_array=False):
434433
"""
435434
Return list of arrays, columns.
436435
"""
@@ -457,8 +456,11 @@ def to_arrays(data, columns, coerce_float=False, dtype=None,
457456
return _list_to_arrays(data, columns, coerce_float=coerce_float, dtype=dtype)
458457
elif isinstance(data[0], abc.Mapping):
459458
return _list_of_dict_to_arrays(
460-
data, columns, coerce_float=coerce_float, dtype=dtype,
461-
to_integer_array=to_integer_array
459+
data,
460+
columns,
461+
coerce_float=coerce_float,
462+
dtype=dtype,
463+
to_integer_array=to_integer_array,
462464
)
463465
elif isinstance(data[0], ABCSeries):
464466
return _list_of_series_to_arrays(
@@ -530,6 +532,7 @@ def _list_of_series_to_arrays(data, columns, coerce_float=False, dtype=None):
530532

531533

532534
def _list_of_dict_to_arrays(data, columns, coerce_float=False, dtype=None):
535+
533536
"""Convert list of dicts to numpy arrays
534537
535538
if `columns` is not passed, column names are inferred from the records
@@ -563,13 +566,17 @@ def _list_of_dict_to_arrays(data, columns, coerce_float=False, dtype=None):
563566

564567
content = list(lib.dicts_to_array(data, list(columns)).T)
565568
return _convert_object_array(
566-
content, columns, dtype=dtype, coerce_float=coerce_float,
567-
to_integer_array=to_integer_array
569+
content,
570+
columns,
571+
dtype=dtype,
572+
coerce_float=coerce_float,
573+
to_integer_array=to_integer_array,
568574
)
569575

570576

571-
def _convert_object_array(content, columns, coerce_float=False, dtype=None,
572-
to_integer_array=False):
577+
def _convert_object_array(
578+
content, columns, coerce_float=False, dtype=None, to_integer_array=False
579+
):
573580
if columns is None:
574581
columns = ibase.default_index(len(content))
575582
else:
@@ -583,8 +590,9 @@ def _convert_object_array(content, columns, coerce_float=False, dtype=None,
583590
# provide soft conversion of object dtypes
584591
def convert(arr):
585592
if dtype != object and dtype != np.object:
586-
arr = lib.maybe_convert_objects(arr, try_float=coerce_float,
587-
to_integer_array=to_integer_array)
593+
arr = lib.maybe_convert_objects(
594+
arr, try_float=coerce_float, to_integer_array=to_integer_array
595+
)
588596
arr = maybe_cast_to_datetime(arr, dtype)
589597
return arr
590598

pandas/io/json/_normalize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def json_normalize(
117117
errors: Optional[str] = "raise",
118118
sep: str = ".",
119119
max_level: Optional[int] = None,
120-
to_integer_array: Optional[bool] = False
120+
to_integer_array: bool = False,
121121
):
122122
"""
123123
Normalize semi-structured JSON data into a flat table.

0 commit comments

Comments
 (0)