Exemplo n.º 1
0
def test_set_from_blank_srs():
    # single cell
    srs = rc.Series(sort=False)
    srs.set(indexes=1, values=9)
    assert srs.index == [1]
    assert srs.data == [9]

    # single column
    srs = rc.Series(sort=False)
    srs.set(indexes=[1, 2, 3], values=[9, 10, 11])
    assert srs.index == [1, 2, 3]
    assert srs.data == [9, 10, 11]
Exemplo n.º 2
0
def test_sort_index():
    # test on list
    srs = rc.Series([4, 5, 6], index=[10, 8, 9], sort=False)

    srs.sort_index()
    assert isinstance(srs.index, list)
    assert_series_equal(srs, rc.Series([5, 6, 4], index=[8, 9, 10], sort=False))

    # fails on mixed type columns
    srs = rc.Series([4, 5, 6], index=[10, 'a', 9])
    with pytest.raises(TypeError):
        srs.sort_index()
Exemplo n.º 3
0
def test_reset_index():
    # no index defined
    srs = rc.Series([4, 5, 6])
    srs.reset_index()
    expected = rc.Series([4, 5, 6])
    assert_series_equal(srs, expected)

    # with index and index name defined
    srs = rc.Series([1, 2, 3], index=['x', 'y', 'z'], index_name='jelo')
    srs.reset_index()
    expected = rc.Series([1, 2, 3], [0, 1, 2], sort=False)
    assert_series_equal(srs, expected)
Exemplo n.º 4
0
def test_from_series_view():
    # sort = False
    ins = rc.Series(data=[4, 5, 6],
                    data_name='b',
                    index=['a', 'b', 9],
                    sort=False)
    srs = rc.ViewSeries.from_series(ins)
    assert srs.sort is False
    assert srs.index is srs.index
    assert srs.data is ins.data

    # change cell
    ins['a'] = 22
    assert srs.data == [22, 5, 6]
    assert srs.index == ['a', 'b', 9]

    # add a row
    ins[11] = -88
    assert srs.data == [22, 5, 6, -88]
    assert srs.index == ['a', 'b', 9, 11]

    # append row
    ins.append_row(12, 77)
    assert srs.data == [22, 5, 6, -88, 77]
    assert srs.index == ['a', 'b', 9, 11, 12]

    # sort = True
    ins = rc.Series(data=[1, 2, 3], data_name='a', index=[0, 1, 5], sort=True)
    srs = rc.ViewSeries.from_series(ins)
    assert srs.sort is True
    assert srs.index is srs.index
    assert srs.data is ins.data

    # change cell
    ins[1] = 22
    assert srs.data == [1, 22, 3]
    assert srs.index == [0, 1, 5]

    # add a row end
    ins[6] = 4
    assert srs.data == [1, 22, 3, 4]
    assert srs.index == [0, 1, 5, 6]

    # add value in middle
    ins[2] = 12
    assert srs.data == [1, 22, 12, 3, 4]
    assert srs.index == [0, 1, 2, 5, 6]

    # append row
    ins.append_row(7, 55)
    assert srs.data == [1, 22, 12, 3, 4, 55]
    assert srs.index == [0, 1, 2, 5, 6, 7]
Exemplo n.º 5
0
def test_append_row():
    actual = rc.Series([7, 9], index=[10, 12], sort=False)

    actual.append_row(9, 99)
    expected = rc.Series([7, 9, 99], index=[10, 12, 9])
    assert_series_equal(actual, expected)

    actual.append_row(16, 100)
    expected = rc.Series([7, 9, 99, 100], index=[10, 12, 9, 16])
    assert_series_equal(actual, expected)

    with pytest.raises(IndexError):
        actual.append_row(10, 100)
Exemplo n.º 6
0
def test_set_index_subset_sort():
    actual = rc.Series([1, 2, 3], index=[10, 11, 12], sort=True)

    # by index value
    actual.set(indexes=[12, 11, 10], values=[66, 55, 44])
    assert actual.data == [44, 55, 66]

    actual.set(indexes=[12, 10], values=[33, 11])
    assert actual.data == [11, 55, 33]

    # new rows at end
    actual.set(indexes=[12, 14, 15], values=[120, 130, 140])
    assert actual.data == [11, 55, 120, 130, 140]
    assert actual.index == [10, 11, 12, 14, 15]

    # new rows at beginning
    actual.set(indexes=[10, 4, 5], values=[-140, -120, -130])
    assert actual.data == [-120, -130, -140, 55, 120, 130, 140]
    assert actual.index == [4, 5, 10, 11, 12, 14, 15]

    # new rows in middle
    actual.set(indexes=[13, 6], values=[3131, 6060])
    assert actual.data == [-120, -130, 6060, -140, 55, 120, 3131, 130, 140]
    assert actual.index == [4, 5, 6, 10, 11, 12, 13, 14, 15]

    # new row new columns
    actual.set(indexes=[14, 15, 16], values=['zoo', 'boo', 'hoo'])
    assert actual.index == [4, 5, 6, 10, 11, 12, 13, 14, 15, 16]
    assert actual.data == [-120, -130, 6060, -140, 55, 120, 3131, 'zoo', 'boo', 'hoo']

    # values list shorter than indexes, raise error
    with pytest.raises(ValueError):
        actual.set(indexes=[10, 11], values=[1])

    # by boolean list
    actual = rc.Series([1, 2], index=['first', 'second'], sort=True)
    actual.set(indexes=[False, True], values=[99])
    assert actual.data == [1, 99]

    # boolean list not size of existing index
    with pytest.raises(ValueError):
        actual.set(indexes=[True, False, True], values=[1, 2])

    # boolean list True entries not same size as values list
    with pytest.raises(ValueError):
        actual.set(indexes=[True, True, False], values=[4, 5, 6])

    with pytest.raises(ValueError):
        actual.set(indexes=[True, True, False], values=[4])
Exemplo n.º 7
0
def test_set_rows_sort():
    actual = rc.Series([7, 8, 9], index=[10, 11, 12], sort=True)

    # change some of the values
    actual.set([11, 12], [88, 99])
    assert actual.data == [7, 88, 99]

    # change all existing values
    actual.set(actual.index, values=[44, 55, 66])
    assert actual.data == [44, 55, 66]

    # modify existing and add a new row
    actual.set([12, 9, 10.5], [666, 77, 1])
    assert actual.data == [77, 44, 1, 55, 666]
    assert actual.index == [9, 10, 10.5, 11, 12]

    # only add a new row
    actual.set([8], [5])
    assert actual.data == [5, 77, 44, 1, 55, 666]
    assert actual.index == [8, 9, 10, 10.5, 11, 12]

    # not enough values
    with pytest.raises(ValueError):
        actual.set(indexes=[True, True, True], values=[1, 2])

    # number of values must equal number of True indexes
    with pytest.raises(ValueError):
        actual.set(indexes=[True, False, True], values=[1, 2, 3])

    # too many values
    with pytest.raises(ValueError):
        actual.set(indexes=[True, True, True, True], values=[1, 2, 3, 4])
Exemplo n.º 8
0
def test_append_rows():
    actual = rc.Series([7, 9], index=[10, 12], sort=False)

    actual.append_rows([9, 11], [99, 100])
    expected = rc.Series([7, 9, 99, 100], index=[10, 12, 9, 11])
    assert_series_equal(actual, expected)

    actual.append_rows([16, 17], [110, 120])
    expected = rc.Series([7, 9, 99, 100, 110, 120], index=[10, 12, 9, 11, 16, 17])
    assert_series_equal(actual, expected)

    with pytest.raises(IndexError):
        actual.append_rows([1, 10], [100, 110])

    with pytest.raises(ValueError):
        actual.append_rows([1, 10], [100, 110, 120])
Exemplo n.º 9
0
def test_set_cell_sort():
    actual = rc.Series([7, 8, 9], index=[10, 12, 13], sort=True)

    # change existing value
    actual.set(12, 55)
    assert actual.get(12) == 55
    actual.set(10, 11)
    assert actual.get(10) == 11
    actual.set(10, 13)
    assert actual.get(10) == 13
    assert actual.data == [13, 55, 9]

    # add a new row
    actual.set(14, 15)
    assert actual.index == [10, 12, 13, 14]
    assert actual.data == [13, 55, 9, 15]

    # row in the middle
    actual.set(11, -1)
    assert actual.index == [10, 11, 12, 13, 14]
    assert actual.data == [13, -1, 55, 9, 15]

    # add before beginning
    actual.set(5, 999)
    assert actual.index == [5, 10, 11, 12, 13, 14]
    assert actual.data == [999, 13, -1, 55, 9, 15]

    # fails for mixed index type
    with pytest.raises(TypeError):
        actual.set('Z', 60)
Exemplo n.º 10
0
def test_use_blist():
    def check_blist():
        assert isinstance(srs.index, blist)
        assert isinstance(srs.data, blist)

    srs = rc.Series(use_blist=True)
    assert isinstance(srs, rc.Series)
    assert srs.data == []
    assert srs.index == []
    assert srs.sort is True
    check_blist()

    # add a new row and col
    srs.set_cell(1, 1)
    check_blist()

    # add a new row
    srs.set_cell(2, 2)
    check_blist()

    # add a new col
    srs.set_cell(1, 3)
    check_blist()

    # add a complete new row
    srs.set_rows([3], [5])
    check_blist()
Exemplo n.º 11
0
def test_index_view():
    data = [4, 5, 6]
    index = ['a', 'b', 'c']

    actual = rc.ViewSeries(data, index)
    result = actual.index
    assert result == ['a', 'b', 'c']
    assert isinstance(result, list)

    # test that a view is returned
    assert result is index
    assert result is actual.index

    # modify
    result[1] = 'new'
    assert actual.index == ['a', 'new', 'c']
    assert index == ['a', 'new', 'c']

    # index too long
    with pytest.raises(ValueError):
        actual.index = [1, 3, 4, 5, 6]

    assert actual.index_name == 'index'
    actual.index_name = 'new name'
    assert actual.index_name == 'new name'

    actual = rc.Series([4, 5, 6], index=['a', 'b', 'c'], index_name='letters')
    assert actual.index_name == 'letters'
Exemplo n.º 12
0
def test_get_slicer():
    srs = rc.Series([7, 8, 9], index=[1, 2, 3], sort=False)

    assert_series_equal(srs[2:3], rc.Series([8, 9], index=[2, 3], sort=False))
    assert_series_equal(srs[1:2], rc.Series([7, 8], index=[1, 2], sort=False))
    assert_series_equal(srs[2:2], rc.Series([8], index=[2], sort=False))

    # test indexes not in the range
    with pytest.raises(IndexError):
        _ = srs[4:5]

    with pytest.raises(IndexError):
        _ = srs[1:8]

    with pytest.raises(IndexError):
        _ = srs[2:1]
Exemplo n.º 13
0
def test_sorted_init():
    # initialized with index defaults to False
    df = rc.Series([5, 4, 6], index=[12, 11, 13])
    assert df.sort is False

    df = rc.Series([5, 4, 6], index=[12, 11, 13], sort=True)
    assert df.sort is True
    assert df.index == [11, 12, 13]
    assert df.data == [4, 5, 6]

    # initialized with no index defaults to True
    df = rc.Series([5, 4, 6])
    assert df.sort is True
    df = rc.Series([5, 4, 6], sort=False)
    assert df.sort is False

    # if sort is true, but no index provided it will assume already in sort order
    df = rc.Series([5, 4, 6], sort=True)
    assert df.sort is True
    assert df.index == [0, 1, 2]
    assert df.data == [5, 4, 6]

    # start un-sort, then set to sort
    df = rc.Series([5, 4, 6], index=[12, 11, 13], sort=False)
    assert df.sort is False
    assert df.index == [12, 11, 13]
    assert df.data == [5, 4, 6]

    df.sort = True
    assert df.index == [11, 12, 13]
    assert df.data == [4, 5, 6]

    # mixed type index will bork on sort=True
    with pytest.raises(TypeError):
        rc.Series([5, 4, 6], index=[1, 'b', 3], sort=True)
Exemplo n.º 14
0
def test_names():
    srs = rc.Series([1, 2])
    assert srs.index_name == 'index'
    assert srs.data_name == 'value'

    srs.index_name = 'new_index'
    srs.data_name = 'data'
    assert srs.index_name == 'new_index'
    assert srs.data_name == 'data'
Exemplo n.º 15
0
def test_get_data_mutability():
    # the .data method only returns a view, and changes to the return values will corrupt the Series
    srs = rc.Series([1.0, 2.55, 3.1])
    orig_data = deepcopy(srs.data)
    data = srs.data

    # regular Series return a view of data
    data.append(99)
    assert srs.data != orig_data
    assert srs.data == [1.0, 2.55, 3.1, 99]

    # using the get commands returns a shallow copy
    srs = rc.Series([[1], [2], [3]])

    # mutate inner value
    srs[1].append(22)
    # changes the new_df
    assert srs.data == [[1], [2, 22], [3]]
Exemplo n.º 16
0
def test_default_empty_init():
    actual = rc.Series(index=[1, 2, 3], data_name='points', dropin=blist)
    assert actual.data == [None, None, None]
    assert actual.data_name == 'points'
    assert actual.index == [1, 2, 3]
    assert actual.index_name == 'index'
    assert actual.sort is False
    assert isinstance(actual.index, blist)
    assert isinstance(actual.data, blist)
Exemplo n.º 17
0
def test_sort_multi_index():
    srs = rc.Series([4, 5, 6],
                    index=[(10, 'c'), (10, 'a'), (10, 'b')],
                    sort=False)

    srs.sort_index()
    assert isinstance(srs.index, list)
    assert_series_equal(
        srs,
        rc.Series([5, 6, 4],
                  index=[(10, 'a'), (10, 'b'), (10, 'c')],
                  sort=False))

    # fails on mixed type columns
    srs = rc.Series([4, 5, 6], index=[(10, 'c'), 'a', (10, 'b')])
    if PYTHON3:
        with pytest.raises(TypeError):
            srs.sort_index()
Exemplo n.º 18
0
def test_data_function():
    # Example function for testing
    def assert_approx_equal(left_data, right_data, precision=0.00001):
        for i in range(len(left_data)):
            assert abs(left_data[i] - right_data[i]) <= precision

    srs1 = rc.Series([1.0, 3.0], index=[1, 3])
    srs2 = rc.Series([1.0, 3.001], index=[1, 3])

    # confirm fails with standard compare
    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2)

    # passes with function and proper parameters
    assert_series_equal(srs1, srs2, assert_approx_equal, {'precision': 0.01})

    # fails with function and precision parameter to low
    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2, assert_approx_equal, {'precision': 0.00001})
Exemplo n.º 19
0
def test_from_series():
    srs = rc.Series(data=[4, 5, 6], index=['a', 'b', 9], data_name='b')
    actual = rc.ViewSeries.from_series(srs)
    expected = rc.ViewSeries([4, 5, 6], data_name='b', index=['a', 'b', 9])
    assert_series_equal(actual, expected)

    srs = rc.Series(data=[1, 2, 3],
                    data_name='a',
                    index=['a', 'b', 'e'],
                    sort=True,
                    index_name='date')
    actual = rc.ViewSeries.from_series(srs, -1)
    expected = rc.ViewSeries([1, 2, 3],
                             data_name='a',
                             index=['a', 'b', 'e'],
                             sort=True,
                             offset=-1,
                             index_name='date')
    assert_series_equal(actual, expected)
Exemplo n.º 20
0
def test_default_empty_init():
    actual = rc.Series()
    assert isinstance(actual, rc.Series)
    assert actual.data == []
    assert actual.data_name == 'value'
    assert actual.index == []
    assert actual.sort is True
    assert isinstance(actual.index, list)
    assert isinstance(actual.data, list)

    actual = rc.Series(sort=False)
    assert actual.sort is False
    assert isinstance(actual.index, list)
    assert isinstance(actual.data, list)

    actual = rc.Series(data_name='points')
    assert actual.data == []
    assert actual.data_name == 'points'
    assert actual.index == []
    assert actual.sort is True
    assert isinstance(actual.index, list)
    assert isinstance(actual.data, list)

    actual = rc.Series(index=[1, 2, 3], data_name='points')
    assert actual.data == [None, None, None]
    assert actual.data_name == 'points'
    assert actual.index == [1, 2, 3]
    assert actual.sort is False
    assert isinstance(actual.index, list)
    assert isinstance(actual.data, list)

    actual = rc.Series(index=[1, 2, 3],
                       index_name='dates',
                       data_name='points',
                       sort=True)
    assert actual.data == [None, None, None]
    assert actual.data_name == 'points'
    assert actual.index == [1, 2, 3]
    assert actual.index_name == 'dates'
    assert actual.sort is True
    assert isinstance(actual.index, list)
    assert isinstance(actual.data, list)
Exemplo n.º 21
0
def test_delete():
    srs = rc.Series([1, 2, 3], index=['a', 'b', 'c'])

    srs.delete(['a', 'c'])
    assert_series_equal(srs, rc.Series([2], index=['b']))

    srs.delete('b')
    assert_series_equal(srs, rc.Series(sort=False))

    # insert back in data
    srs[1] = 9
    assert srs.data == [9]
    assert srs.index == [1]

    srs[2] = 8
    assert srs.data == [9, 8]
    assert srs.index == [1, 2]

    srs = rc.Series([4, 5, 6], index=['a', 'b', 'c'])
    # cannot delete values not in index
    with pytest.raises(ValueError):
        srs.delete(['bad'])

    # length of boolean must be len of index
    with pytest.raises(ValueError):
        srs.delete([True, False])

    srs.delete([True, False, True])
    assert_series_equal(srs, rc.Series([5], index=['b']))

    srs.delete([True])
    assert_series_equal(srs, rc.Series(sort=False))
Exemplo n.º 22
0
def test_set_square_brackets():
    srs = rc.Series(sort=False)

    srs[1] = 2
    assert srs.data == [2]
    assert srs.index == [1]

    # srs[[0, 3]] - - set index = [0, 3]
    srs[[0, 3]] = 4
    assert srs.data == [2, 4, 4]
    assert srs.index == [1, 0, 3]

    # srs[1:2] - - set index slice 1:2
    srs[1:3] = 5
    assert srs.data == [5, 5, 5]
    assert srs.index == [1, 0, 3]
    assert srs.sort is False

    # with sort = True
    srs = rc.Series(sort=True)

    srs[1] = 2
    assert srs.data == [2]
    assert srs.index == [1]

    # srs[[0, 3]] - - set index = [0, 3]
    srs[[0, 3]] = 4
    assert srs.data == [4, 2, 4]
    assert srs.index == [0, 1, 3]

    # srs[1:2] - - set index slice 1:2
    srs[1:3] = 5
    assert srs.data == [4, 5, 5]
    assert srs.index == [0, 1, 3]
    assert srs.sort is True

    # insert
    srs[2] = 6
    assert srs.data == [4, 5, 6, 5]
    assert srs.index == [0, 1, 2, 3]
Exemplo n.º 23
0
def test_default_init():
    # no index
    actual = rc.Series([4, 5, 6])
    assert actual.data == [4, 5, 6]
    assert actual.data_name == 'value'
    assert actual.index == [0, 1, 2]
    assert actual.sort is True
    assert isinstance(actual.index, list)
    assert isinstance(actual.data, list)
    assert len(actual) == 3

    # with index
    actual = rc.Series(data=[4, 5, 6],
                       index=['a', 'b', 'c'],
                       index_name='letters')
    assert actual.data == [4, 5, 6]
    assert actual.index == ['a', 'b', 'c']
    assert actual.index_name == 'letters'
    assert actual.sort is False
    assert isinstance(actual.index, list)
    assert isinstance(actual.data, list)
    assert len(actual) == 3
Exemplo n.º 24
0
def test_from_series_view_breaks():
    # These actions will break the view link between the Series and the ViewSeries

    # changing index
    ins = rc.Series(data=[1, 2, 3], data_name='a', index=[0, 1, 5], sort=True)
    srs = rc.ViewSeries.from_series(ins)
    assert srs.index is ins.index
    assert srs.data is ins.data

    ins.index = [1, 2, 3]
    assert srs.index is not ins.index
    assert srs.data is ins.data

    # sorting index
    ins = rc.Series(data=[1, 2, 3], data_name='a', index=[0, 1, 5], sort=True)
    srs = rc.ViewSeries.from_series(ins)
    assert srs.index is ins.index
    assert srs.data is ins.data

    ins.sort_index()
    assert srs.index is not ins.index
    assert srs.data is not ins.data
Exemplo n.º 25
0
def test_equality():
    srs = rc.Series([1, 2, 1, 2, 1, 1])
    assert srs.sort is True

    assert srs.equality(value=1) == [True, False, True, False, True, True]
    assert srs.equality([1, 2, 3], 2) == [True, False, True]
    assert srs.equality([False, False, False, True, True, True], 1) == [False, True, True]

    # change all 1 to 3
    srs.set(indexes=srs.equality(value=1), values=3)
    assert srs.data == [3, 2, 3, 2, 3, 3]

    srs = rc.Series([1, 2, 1, 2, 1, 1], sort=False)
    assert srs.sort is False

    assert srs.equality(value=1) == [True, False, True, False, True, True]
    assert srs.equality([1, 2, 3], 2) == [True, False, True]
    assert srs.equality([False, False, False, True, True, True], 1) == [False, True, True]

    # not enough booleans to match index len
    with pytest.raises(ValueError):
        srs.equality([True, True], 2)
Exemplo n.º 26
0
def test_head():
    srs = rc.Series([3, 4, 5], sort=False)

    assert_series_equal(srs.head(0), rc.Series([], [], sort=False))
    assert_series_equal(srs.head(1), rc.Series([3], sort=False))
    assert_series_equal(srs.head(2), rc.Series([3, 4], sort=False))
    assert_series_equal(srs.head(3), rc.Series([3, 4, 5], sort=False))
    assert_series_equal(srs.head(999), rc.Series([3, 4, 5], sort=False))
Exemplo n.º 27
0
def test_get_rows_sorted():
    srs = rc.Series([1, 2, 3, 4],
                    index=[10, 11, 12, 99],
                    index_name='start_10',
                    sort=True)

    expected = rc.Series([2, 3],
                         index=[11, 12],
                         index_name='start_10',
                         sort=True)
    actual = srs.get([11, 12])
    assert_series_equal(actual, expected)

    # test with boolean list
    actual = srs.get([False, True, True, False])
    assert_series_equal(actual, expected)

    # index out of order
    expected = rc.Series([4, 1],
                         index=[99, 10],
                         index_name='start_10',
                         sort=True)
    actual = srs.get([99, 10])
    assert_series_equal(actual, expected)

    # get as a list
    assert srs.get([11, 12], as_list=True) == [2, 3]

    # get as a list
    assert srs.get([False, True, True, False], as_list=True) == [2, 3]

    # items not in index raise errors
    with pytest.raises(ValueError):
        srs.get([11, 88], as_list=True)

    # not enough items in boolean list
    with pytest.raises(ValueError):
        srs.get([True, True])
Exemplo n.º 28
0
def test_get_slicer_sorted():
    srs = rc.Series([7, 8, 9], index=[1, 2, 3], sort=True)

    assert_series_equal(srs[2:3], rc.Series([8, 9], index=[2, 3], sort=True))
    assert_series_equal(srs[1:2], rc.Series([7, 8], index=[1, 2], sort=True))
    assert_series_equal(srs[0.5:2.5], rc.Series([7, 8],
                                                index=[1, 2],
                                                sort=True))
    assert_series_equal(srs[2:2], rc.Series([8], index=[2], sort=True))

    assert_series_equal(srs[4:5], rc.Series([], index=[], sort=True))
    assert_series_equal(srs[2:1], rc.Series([], index=[], sort=True))
    assert_series_equal(srs[1:8], srs)
Exemplo n.º 29
0
def test_views():
    # assert that df.data is data and df.index are copies and do not alter input data
    data = [4, 5, 6]
    index = ['a', 'b', 'c']
    actual = rc.Series(data=data, index=index)

    assert actual.data is not data
    assert actual.index is not index

    # change input data, no change to series
    data.append(7)
    index.append('e')

    assert actual.data == [4, 5, 6]
    assert actual.index == ['a', 'b', 'c']
Exemplo n.º 30
0
def test_index():
    actual = rc.Series([4, 5, 6], index=['a', 'b', 'c'])
    result = actual.index
    assert result == ['a', 'b', 'c']
    assert isinstance(result, list)

    # test that a view is returned
    result.append('bad')
    assert actual.index == ['a', 'b', 'c', 'bad']

    actual.index = [9, 10, 11]
    assert actual.index == [9, 10, 11]
    assert isinstance(result, list)

    # index too long
    with pytest.raises(ValueError):
        actual.index = [1, 3, 4, 5, 6]

    assert actual.index_name == 'index'
    actual.index_name = 'new name'
    assert actual.index_name == 'new name'

    actual = rc.Series([4, 5, 6], index=['a', 'b', 'c'], index_name='letters')
    assert actual.index_name == 'letters'