Hi, I have tried Series.append but the name property changes unexpectedly.

a = pd.Series(name='a')
b = pd.Series(name='b')
c = pd.Series()

# a.name turns to be None if a.name is different with b.name
a.append(b) # a.name is None after append

# a.name turns to be None if c dose not have a name
a.append(c) # a.name is None after append

# a.name remains unchanged
a.append(pd.Series(name=a.name)) # a.name dose not change

Problem description

As a new series is appended to an old one, the name of the old series should be unchanged. This should not be satisfied only when the name of the new series is explicitly specified. However, the above problem happens.

Expected Output

Whenever a.append(b) or a.append(c) is done, a.name should remain unchanged, which is 'a'.

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.5.1.final.0 python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None pandas: 0.19.1 nose: 1.3.7 pip: 8.1.2 setuptools: 19.2 Cython: 0.23.4 numpy: 1.11.0 scipy: 0.17.0 statsmodels: 0.6.1 xarray: None IPython: 4.1.2 sphinx: 1.3.1 patsy: 0.4.0 dateutil: 2.5.1 pytz: 2016.2 blosc: None bottleneck: 1.0.0 tables: 3.2.2 numexpr: 2.5.1 matplotlib: 1.5.1 openpyxl: 2.3.2 xlrd: 0.9.4 xlwt: 1.0.0 xlsxwriter: 0.8.4 lxml: 3.6.0 bs4: 4.4.1 html5lib: None httplib2: None apiclient: None sqlalchemy: 1.0.12 pymysql: None psycopg2: None jinja2: 2.8 boto: 2.39.0 pandas_datareader: None

Comment From: jorisvandenbossche

We have a lot of issues (and fixes) of names getting lost, see https://github.com/pandas-dev/pandas/issues/9862 for an overview. But I think the behaviour here (only retaining name if the names match) is on purpose and tested behaviour (@sinhrks?) What does not mean of course that this choice cannot be challenged.

Comment From: shuuchen

thanks!

Comment From: jreback

yes this is correct and expected.

Comment From: Michael-E-Rose

If it's expected and desired it should be mentioned in the documentation: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.append.html

Comment From: jorisvandenbossche

@Michael-E-Rose indeed (and you are welcome to do a small PR to update it!)