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

# This is a DOCbug simply to document what pd.DataFrame(dtype) currently does.
# It is non-obvious to new users, gives non-obvious error messages, and also behaves differently to read_csv(dtype)

# a) Leaving dtype=None in constructor will infer a wider type than necessary
df_cols = {'year':np.int32, 'month':np.int8}
df = pd.DataFrame(columns=df_cols.keys(), dtype=None, index=range(10), data=-1)
>>> df.dtypes
month int64
year int64

# b) The doc doesn't explicitly say a list/dict/Series/array-like is not allowed (and if you
# pass in one the error is not very friendly). Also behaves differently to read_csv(dtype)
df = pd.DataFrame(columns=df_cols.keys(), dtype=np.int32, index=range(10), data=-1)
# df.dtypes shows they're all np.int32
# Fix up dtypes after declaration
for col,coltype in df_cols.items():
df[col] = df[col].astype(coltype)

Problem description

The DataFrame() doc doesn't explicitly say a list/dict/Series/array-like is not allowed (and if you pass in one the error is not very friendly). Also behaves differently to read_csv(dtype).

Leaving dtype=None in constructor will infer a wider type than necessary.

So in general you either set dtype=widest_necessary_type, or dtype=None and then manually fix them up after declaration, by casting with astype()

Expected Output

Output of pd.show_versions()

python: 2.7.10.final.0
python-bits: 64
machine: x86_64
processor: i386
byteorder: little
pandas: 0.19.1
numpy: 1.11.2
scipy: 0.18.1

Issue 2:
I have a dataframe called delivery and when I print(delivery.columns) I get the following:

Index(['Complemento_endereço', 'cnpj', 'Data_fundação', 'Número',
'Razão_social', 'CEP', 'situacao_cadastral', 'situacao_especial', 'Rua',
'Nome_Fantasia', 'last_revenue_normalized', 'last_revenue_year',
'Telefone', 'email', 'Capital_Social', 'Cidade', 'Estado',
'Razão_social', 'name_bairro', 'Natureza_Jurídica', 'CNAE', '#CNAE',
'CNAEs_secundários', 'Pessoas', 'percent'],
dtype='object')

Well, we can clearly see that there is a column 'Rua'.

Also, if I print(delivery.Rua) I get a proper result:

82671 R JUDITE MELO DOS SANTOS
817797 R DOS GUAJAJARAS
180081 AV MARCOS PENTEADO DE ULHOA RODRIGUES
149373 AL MARIA TEREZA
455511 AV RANGEL PESTANA
...

Even if I write "if 'Rua' in delivery.columns: print('here I am')" it does print the 'here I am'. So 'Rua' is in fact there.

Well, in the immediate line after I have this code:

delivery=delivery.set_index('cnpj')[['Razão_social','Nome_Fantasia','Data_fundação','CEP','Estado','Cidade','Bairro','Rua','Número','Complemento_endereço','Telefone','email','Capital_Social', 'CNAE', '#CNAE', 'Natureza_Jurídica','Pessoas' ]]

And voilá, I get this weird error:

Traceback (most recent call last):
File "/file.py", line 45, in <module>
'Telefone', 'email', 'Capital_Social', 'Cidade', 'Estado',
'Razão_social', 'name_bairro', 'Natureza_Jurídica', 'CNAE', '#CNAE',
'Telefone','email','Capital_Social', 'CNAE', '#CNAE', 'Natureza_Jurídica','Pessoas' ]]
'CNAEs_secundários', 'Pessoas', 'percent'],
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/core/frame.py", line 1991, in __getitem__
dtype='object')
return self._getitem_array(key)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/core/frame.py", line 2035, in _getitem_array
indexer = self.ix._convert_to_indexer(key, axis=1)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/core/indexing.py", line 1214, in _convert_to_indexer
raise KeyError('%s not in index' % objarr[mask])
KeyError: "['Rua'] not in index"

Can someone help? I tried stackoverflow but no one could help. I'm starting to think I'm crazy and 'Rua' is an illusion of my troubled mind.

ADDITIONAL INFO

I'm using this code right before the error line:

delivery=pd.DataFrame()

for i in selection.index:
sample=groups.get_group(selection['#CNAE'].loc[i]).sample(selection['samples'].loc[i])
delivery=pd.concat((delivery,sample)).sort_values('Capital_Social',ascending=False)

print(delivery.columns)
print(delivery.Rua)
print(delivery.set_index('cnpj').columns)

delivery=delivery.set_index('cnpj')[['Razão_social','Nome_Fantasia','Data_fundação','CEP','Estado','Cidade','Bairro','Rua','Número','Complemento_endereço',
'Telefone','email','Capital_Social', 'CNAE', '#CNAE', 'Natureza_Jurídica','Pessoas' ]]

EDIT

New weird stuff:

I gave up and deleted 'Rua' from that last piece of code, wishing that it would work. For my surprise, I had the same problem but now with the column 'Número'.

delivery=delivery.set_index('cnpj')[['Razão_social','Nome_Fantasia','Data_fundação','CEP','Estado','Cidade','Bairro','Número','Complemento_endereço',
'Telefone','email','Capital_Social', 'CNAE', '#CNAE', 'Natureza_Jurídica' ]]

KeyError: "['Número'] not in index"

EDIT 2

And then I gave up on 'Número' and took it out. Then the same problem happened with 'Complemento_endereço'. Then I deleted 'Complemento_endereço'. And it happend to 'Telefone' and so on.

** EDIT 3 **

If I do a pd.show_versions(), that's the output:

INSTALLED VERSIONS

commit: None

python: 3.5.0.final.0

python-bits: 64

OS: Darwin

OS-release: 16.5.0

machine: x86_64

processor: i386

byteorder: little

LC_ALL: None

LANG: None

pandas: 0.18.1

nose: None

pip: 8.1.2

setuptools: 18.2

Cython: None

numpy: 1.11.0

scipy: 0.17.1

statsmodels: 0.6.1

xarray: None

IPython: None

sphinx: None

patsy: 0.4.1

dateutil: 2.5.3

pytz: 2016.4

blosc: None

bottleneck: None

tables: None

numexpr: None

matplotlib: 1.5.1

openpyxl: None

xlrd: 1.0.0

xlwt: None

xlsxwriter: None

lxml: None

bs4: 4.5.1

html5lib: None

httplib2: None

apiclient: None

sqlalchemy: 1.1.3

pymysql: 0.7.11.None

psycopg2: None

jinja2: None

boto: None

pandas_datareader: None

None