Skip to content

Commit fdbba96

Browse files
committed
BUG: (GH4192) fixed broken unit test
1 parent affc8b0 commit fdbba96

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/core/series.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -751,11 +751,12 @@ def where(self, cond, other=nan, inplace=False):
751751

752752
if len(other) != len(ser):
753753
icond = ~cond
754-
754+
print "First", other
755755
# GH 2745
756756
# treat like a scalar
757757
if len(other) == 1:
758-
other = np.repeat(other, len(ser))
758+
other = np.array(other[0])
759+
print "EQ 1", other
759760

760761
# GH 3235
761762
# match True cond to other
@@ -767,7 +768,10 @@ def where(self, cond, other=nan, inplace=False):
767768
other = new_other
768769

769770
else:
771+
print "Raising", other
770772
raise ValueError('Length of replacements must equal series length')
773+
774+
print "Finished", other
771775

772776
change = ser if inplace else None
773777
com._maybe_upcast_putmask(ser,~cond,other,change=change)

0 commit comments

Comments
 (0)