Issue 1:
Code Sample, a copy-pastable example if possible

As expected:

import pandas as pd
all_cols = list("abcdefg")

informative_cols = ["a","c","g"]

dfrandom = pd.DataFrame(pd.np.random.rand(5, len(all_cols)), columns=all_cols)

field = informative_cols[0]
print(field)
print(type(dfrandom[field]))
print(type(dfrandom[informative_cols][field]))

returns:

a
<class 'pandas.core.series.Series'>
<class 'pandas.core.series.Series'>

However, unexpectedly:

import pandas as pd
all_cols = list("abcdefg")

informative_cols = ["a","c","g"]

dfrandom = pd.DataFrame(pd.np.random.rand(5, len(all_cols)), columns=all_cols)

field = informative_cols[0]
print(field)
print(type(dfrandom[field]))
print(type(dfrandom[informative_cols][field]))

returns:

0_AnatomicRegionSequence_CodeMeaning
<class 'pandas.core.series.Series'>
<class 'pandas.core.frame.DataFrame'>

Problem description

Subsetting one single column with a string must output the same result independent of copying and previous subsetting.

Because expected output is consistent and unexpected is inconsistent

Expected Output

0_AnatomicRegionSequence_CodeMeaning
<class 'pandas.core.series.Series'>
<class 'pandas.core.series.Series'>

Output of pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 3.6.1.final.0
python-bits: 64
OS: Linux
OS-release: 4.2.0-42-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.20.2

pytest: None

pip: 9.0.1

setuptools: 36.0.1

Cython: None

numpy: 1.13.0

scipy: 0.19.0

xarray: None

IPython: 6.1.0

sphinx: None

patsy: 0.4.1

dateutil: 2.6.0

pytz: 2017.2

blosc: None

bottleneck: None

tables: None

numexpr: None

feather: None

matplotlib: 2.0.2

openpyxl: None

xlrd: None

xlwt: None

xlsxwriter: None

lxml: None

bs4: None

html5lib: 0.999999999

sqlalchemy: None

pymysql: None

psycopg2: None

jinja2: 2.9.6

s3fs: None

pandas_gbq: None

pandas_datareader: None

Issue 2:
In [6]: DataFrame.from_records( [(1,2,3)], columns=['a','b','a'])

IndexError Traceback (most recent call last)

/home/adam/bin/jtds/ in ()

----> 1 DataFrame.from_records( [(1,2,3)], columns=['a','b','a'])

/home/adam/code/pandas/pandas/core/frame.pyc in from_records(cls, data, index, exclude, columns, names, coerce_float)

760 result_index = np.arange(len(data))

761

--> 762 return cls(sdict, index=result_index, columns=columns)

763

764 def to_records(self, index=True):

/home/adam/code/pandas/pandas/core/frame.pyc in init(self, data, index, columns, dtype, copy)

301 mgr = self._init_mgr(data, index, columns, dtype=dtype, copy=copy)

302 elif isinstance(data, dict):

--> 303 mgr = self._init_dict(data, index, columns, dtype=dtype)

304 elif isinstance(data, ma.MaskedArray):

305 mask = ma.getmaskarray(data)

/home/adam/code/pandas/pandas/core/frame.pyc in _init_dict(self, data, index, columns, dtype)

391

392 # segregates dtypes and forms blocks matching to columns

--> 393 blocks = form_blocks(homogenized, axes)

394

395 # consolidate for now

/home/adam/code/pandas/pandas/core/internals.pyc in form_blocks(data, axes)

1125

1126 if len(int_dict):

-> 1127 int_block = _simple_blockify(int_dict, items, np.int64)

1128 blocks.append(int_block)

1129

/home/adam/code/pandas/pandas/core/internals.pyc in _simple_blockify(dct, ref_items, dtype)

1154

1155 def _simple_blockify(dct, ref_items, dtype):

-> 1156 block_items, values = _stack_dict(dct, ref_items, dtype)

1157 # CHECK DTYPE?

1158 if values.dtype != dtype: # pragma: no cover

/home/adam/code/pandas/pandas/core/internals.pyc in _stack_dict(dct, ref_items, dtype)

1187 stacked = np.empty(shape, dtype=dtype)

1188 for i, item in enumerate(items):

-> 1189 stacked[i] = _asarray_compat(dct[item])

1190

1191 # stacked = np.vstack([_asarray_compat(dct[k]) for k in items])

IndexError: index out of bounds