File tree 1 file changed +4
-11
lines changed
pandas/tests/sparse/frame
1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -156,15 +156,6 @@ def test_constructor_ndarray(self, float_frame):
156
156
SparseDataFrame (float_frame .values ,
157
157
columns = float_frame .columns [:- 1 ])
158
158
159
- def test_construct_unmatched_sparsedataframe (self , float_frame ):
160
- # GH25484
161
- dates = pd .bdate_range ('1/1/2011' , periods = 10 )
162
- sp = SparseDataFrame (float_frame .values , index = dates )
163
- N = len (sp )
164
- msg = 'Length of values does not match length of index'
165
- with pytest .raises (ValueError , match = msg ):
166
- sp ['foo' ] = np .random .randn (N - 1 )
167
-
168
159
# GH 9272
169
160
def test_constructor_empty (self ):
170
161
sp = SparseDataFrame ()
@@ -560,8 +551,10 @@ def _check_frame(frame, orig):
560
551
assert len (frame ['I' ].sp_values ) == N // 2
561
552
562
553
# insert ndarray wrong size
563
- pytest .raises (Exception , frame .__setitem__ , 'foo' ,
564
- np .random .randn (N - 1 ))
554
+ # GH 25484
555
+ msg = 'Length of values does not match length of index'
556
+ with pytest .raises (ValueError , match = msg ):
557
+ frame ['foo' ] = np .random .randn (N - 1 )
565
558
566
559
# scalar value
567
560
frame ['J' ] = 5
You can’t perform that action at this time.
0 commit comments