<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: %paste
import datetime
from dateutil.tz import tzlocal, tzutc
import pandas

d = {
    datetime.datetime(2016, 8, 26, 20, 23, tzinfo=tzlocal()): {
        'A': 10481.0,
        'B': 12,
        'C': 'text'
    },
    datetime.datetime(2016, 8, 26, 20, 24, tzinfo=tzlocal()): {
        'A': 10480.5,
        'B': 13,
        'C': 'text'
    }
}

df = pandas.DataFrame(d).T
df2 = df.set_index(['C'], append=True)
## -- End pasted text --

In [2]: df
Out[2]: 
                                 A   B     C
2016-08-26 20:23:00+02:00    10481  12  text
2016-08-26 20:24:00+02:00  10480.5  13  text

In [3]: df2
Out[3]: 
                                      A   B
                          C                
2016-08-26 20:23:00+02:00 text    10481  12
1970-01-01 00:00:00+01:00 text  10480.5  13"><pre class="notranslate"><code class="notranslate">In [1]: %paste
import datetime
from dateutil.tz import tzlocal, tzutc
import pandas

d = {
    datetime.datetime(2016, 8, 26, 20, 23, tzinfo=tzlocal()): {
        'A': 10481.0,
        'B': 12,
        'C': 'text'
    },
    datetime.datetime(2016, 8, 26, 20, 24, tzinfo=tzlocal()): {
        'A': 10480.5,
        'B': 13,
        'C': 'text'
    }
}

df = pandas.DataFrame(d).T
df2 = df.set_index(['C'], append=True)
## -- End pasted text --

In [2]: df
Out[2]: 
                                 A   B     C
2016-08-26 20:23:00+02:00    10481  12  text
2016-08-26 20:24:00+02:00  10480.5  13  text

In [3]: df2
Out[3]: 
                                      A   B
                          C                
2016-08-26 20:23:00+02:00 text    10481  12
1970-01-01 00:00:00+01:00 text  10480.5  13
</code></pre></div>
<h4 dir="auto">Expected Output</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [3]: df2
Out[3]: 
                                      A   B
                          C                
2016-08-26 20:23:00+02:00 text    10481  12
2016-08-26 20:24:00+02:00 text  10480.5  13"><pre class="notranslate"><code class="notranslate">In [3]: df2
Out[3]: 
                                      A   B
                          C                
2016-08-26 20:23:00+02:00 text    10481  12
2016-08-26 20:24:00+02:00 text  10480.5  13
</code></pre></div>
<p dir="auto">Note, issue goes away when removing the <code class="notranslate">tzinfo=tzlocal()</code>. Or just using <code class="notranslate">tzinfo=tzutc()</code>. It can also be reproduced using <code class="notranslate">MultiIndex()</code> with tuples instead of <code class="notranslate">set_index()</code>.</p>
<h4 dir="auto">Using pytz works</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import datetime
import pytz
import tzlocal
import pandas

local_tz = tzlocal.get_localzone()

d = {
    datetime.datetime(2016, 8, 26, 20, 23, tzinfo=pytz.utc).astimezone(local_tz): {
        'A': 10481.0,
        'B': 12,
        'C': 'text'
    },
    datetime.datetime(2016, 8, 26, 20, 24, tzinfo=pytz.utc).astimezone(local_tz): {
        'A': 10480.5,
        'B': 13,
        'C': 'text'
    }
}

df = pandas.DataFrame(d).T
df2 = df.set_index(['C'], append=True)"><pre class="notranslate"><code class="notranslate">import datetime
import pytz
import tzlocal
import pandas

local_tz = tzlocal.get_localzone()

d = {
    datetime.datetime(2016, 8, 26, 20, 23, tzinfo=pytz.utc).astimezone(local_tz): {
        'A': 10481.0,
        'B': 12,
        'C': 'text'
    },
    datetime.datetime(2016, 8, 26, 20, 24, tzinfo=pytz.utc).astimezone(local_tz): {
        'A': 10480.5,
        'B': 13,
        'C': 'text'
    }
}

df = pandas.DataFrame(d).T
df2 = df.set_index(['C'], append=True)
</code></pre></div>
<h4 dir="auto">output of <code class="notranslate">pd.show_versions()</code></h4>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.5.1.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.6.6-300.fc24.x86_64<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.utf8</p>
<p dir="auto">pandas: 0.18.0<br>
nose: None<br>
pip: 8.0.2<br>
setuptools: 20.1.1<br>
Cython: 0.23.4<br>
numpy: 1.11.0<br>
scipy: 0.16.1<br>
statsmodels: 0.6.1<br>
xarray: None<br>
IPython: 3.2.1<br>
sphinx: None<br>
patsy: 0.4.1<br>
dateutil: 2.5.2<br>
pytz: 2016.6.1<br>
blosc: None<br>
bottleneck: 0.6.0<br>
tables: 3.2.2<br>
numexpr: 2.6.1<br>
matplotlib: 1.5.2rc2<br>
openpyxl: None<br>
xlrd: 0.9.4<br>
xlwt: 1.0.0<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: None<br>
httplib2: None<br>
apiclient: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: 2.6.1 (dt dec pq3 ext lo64)<br>
jinja2: 2.8<br>
boto: None</p>
<ul dir="auto">
<li>the <code class="notranslate">columns</code> argument gets clobbered:<br>
In [13]: pd.DataFrame.from_records({1:["foo"],2:["bar"]},columns=['a','b']).columns<br>
Out[13]: Index([1, 2], dtype=int64)</li>
<li>if <code class="notranslate">index</code> is specified, and <code class="notranslate">result_index</code> computed, it will get clobbered<br>
later on.</li>
<li>if <code class="notranslate">index</code> is specified as a list of labels, with the first few matching columns names<br>
and the others not, then sdict will get mutilated, because the removal of columns<br>
occurs within the try clause rather then after success.<br>
<strong>EDIT</strong> - ignore, I misread the code.</li>
<li>There's duplication against the main Dataframe ctor which also accepts dicts and arrays,<br>
and The exclusion  and float coercsion which are unique to <code class="notranslate">from_records()</code> would be useful<br>
to have generally available in the main ctor anyway.</li>
<li>It's unclear if the <code class="notranslate">columns</code> argument should be specified relative to the original<br>
data, or relative to the data modulo excluded columns</li>
<li>Doesn't support duplicate column names (Although that's checked with<br>
a warning)</li>
<li>the docstring specifies the datatypes for <code class="notranslate">data</code> , which do not include a dict.<br>
But the code specifically checks and handles dict input, This is a minor thing, but<br>
using <code class="notranslate">columns</code> along with dict is not well defined because of key (non-)ordering,<br>
so the original docstring spec seems more sane.</li>
</ul>