Example #1
0
 def test_ix_setitem_out_of_bounds_axis_0(self):
     df = DataFrame(
         np.random.randn(2, 5), index=["row%s" % i for i in range(2)],
         columns=["col%s" % i for i in range(5)])
     with catch_warnings(record=True):
         msg = "cannot set by positional indexing with enlargement"
         with pytest.raises(ValueError, match=msg):
             df.ix[2, 0] = 100
Example #2
0
    def test_value_range(self):
        df = DataFrame(np.random.randn(5, 5))
        df.ix[0, 2] = -5
        df.ix[2, 0] = 5

        res = value_range(df)

        self.assertEqual(res['Minimum'], -5)
        self.assertEqual(res['Maximum'], 5)

        df.ix[0, 1] = np.NaN

        self.assertEqual(res['Minimum'], -5)
        self.assertEqual(res['Maximum'], 5)
def test_value_range():
    df = DataFrame(np.random.randn(5, 5))
    df.ix[0, 2] = -5
    df.ix[2, 0] = 5

    res = value_range(df)

    assert(res['Minimum'] == -5)
    assert(res['Maximum'] == 5)

    df.ix[0, 1] = np.NaN

    assert(res['Minimum'] == -5)
    assert(res['Maximum'] == 5)