Skip to content

Commit 8a8c670

Browse files
committed
applied linting
1 parent 65df683 commit 8a8c670

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pandas/core/construction.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,10 +614,10 @@ def sanitize_array(
614614
# GH#61026: special-case 2D+ object ndarrays when dtype is None.
615615
if data.dtype == object and data.ndim > 1:
616616
if data.ndim == 2 and data.shape[1] == 1:
617-
# allow assigning a (n, 1) object array to a single column, flatten it:
617+
# allow assigning a (n, 1) object array to a single column.
618618
data = data[:, 0]
619619
elif data.ndim == 2:
620-
# More than one column but caller is behaving as if this is a single-column assignment.
620+
# more than 1 column, now allowed.
621621
raise ValueError(
622622
"Setting a DataFrame column with a 2D object array "
623623
f"requires shape (n, 1); got shape {data.shape}."
@@ -628,7 +628,7 @@ def sanitize_array(
628628
f"Setting a DataFrame column with ndim {data.ndim} "
629629
"object array is not supported."
630630
)
631-
631+
632632
subarr = data
633633
if data.dtype == object and infer_object:
634634
subarr = lib.maybe_convert_objects(

pandas/tests/frame/indexing/test_setitem_2d_object.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
2+
import pytest
3+
24
import pandas as pd
35
import pandas._testing as tm
4-
import pytest
56

67

78
class TestSetItem2DObjectArray:

0 commit comments

Comments
 (0)