@@ -847,6 +847,17 @@ def test_irow(self):
847
847
expected = df .ix [8 :14 ]
848
848
assert_frame_equal (result , expected )
849
849
850
+ # verify slice is view
851
+ result [2 ] = 0.
852
+ exp_col = df [2 ].copy ()
853
+ exp_col [4 :8 ] = 0.
854
+ assert_series_equal (df [2 ], exp_col )
855
+
856
+ # list of integers
857
+ result = df .irow ([1 , 2 , 4 , 6 ])
858
+ expected = df .reindex (df .index [[1 , 2 , 4 , 6 ]])
859
+ assert_frame_equal (result , expected )
860
+
850
861
def test_icol (self ):
851
862
df = DataFrame (np .random .randn (4 , 10 ), columns = range (0 , 20 , 2 ))
852
863
@@ -863,6 +874,15 @@ def test_icol(self):
863
874
expected = df .ix [:, 8 :14 ]
864
875
assert_frame_equal (result , expected )
865
876
877
+ # verify slice is view
878
+ result [8 ] = 0.
879
+ self .assert_ ((df [8 ] == 0 ).all ())
880
+
881
+ # list of integers
882
+ result = df .icol ([1 , 2 , 4 , 6 ])
883
+ expected = df .reindex (columns = df .columns [[1 , 2 , 4 , 6 ]])
884
+ assert_frame_equal (result , expected )
885
+
866
886
def test_iget_value (self ):
867
887
for i , row in enumerate (self .frame .index ):
868
888
for j , col in enumerate (self .frame .columns ):
0 commit comments