<p dir="auto">Hi, using different indexers on a dataframes with timezone-aware timestamps may return naive timestamps. (A brief search attempt didn't turn up any related issues.)</p>
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import pandas as pd
&gt;&gt;&gt; df = pd.Series([pd.tslib.Timestamp('2016-03-30 14:35:25.506088-04:00')]).to_frame()
&gt;&gt;&gt; df = pd.concat([df, df]).reset_index(drop=True)
&gt;&gt;&gt; df[0][0]
Timestamp('2016-03-30 14:35:25.506088-0400', tz='pytz.FixedOffset(-240)')
&gt;&gt;&gt; df.iloc[0,0]
Timestamp('2016-03-30 14:35:25.506088-0400', tz='pytz.FixedOffset(-240)')
&gt;&gt;&gt; df.loc[0,0]
Timestamp('2016-03-30 14:35:25.506088-0400', tz='pytz.FixedOffset(-240)')
&gt;&gt;&gt; df.iat[0,0]
Timestamp('2016-03-30 14:35:25.506088-0400', tz='pytz.FixedOffset(-240)')
&gt;&gt;&gt; df.at[0,0]
Timestamp('2016-03-30 18:35:25.506088')
&gt;&gt;&gt; df.ix[0,0]
Timestamp('2016-03-30 18:35:25.506088')
&gt;&gt;&gt; df.ix[0]
Timestamp('2016-03-30 14:35:25.506088-0400', tz='pytz.FixedOffset(-240)')
&gt;&gt;&gt; df[0].at[0]
Timestamp('2016-03-30 14:35:25.506088-0400', tz='pytz.FixedOffset(-240)')
&gt;&gt;&gt; df[0].ix[0]
Timestamp('2016-03-30 14:35:25.506088-0400', tz='pytz.FixedOffset(-240)')
"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-s1">pd</span>.<span class="pl-s1">tslib</span>.<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 14:35:25.506088-04:00'</span>)]).<span class="pl-en">to_frame</span>()
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">concat</span>([<span class="pl-s1">df</span>, <span class="pl-s1">df</span>]).<span class="pl-en">reset_index</span>(<span class="pl-s1">drop</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>[<span class="pl-c1">0</span>][<span class="pl-c1">0</span>]
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 14:35:25.506088-0400'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-240)'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">0</span>,<span class="pl-c1">0</span>]
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 14:35:25.506088-0400'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-240)'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[<span class="pl-c1">0</span>,<span class="pl-c1">0</span>]
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 14:35:25.506088-0400'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-240)'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>.<span class="pl-s1">iat</span>[<span class="pl-c1">0</span>,<span class="pl-c1">0</span>]
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 14:35:25.506088-0400'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-240)'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>.<span class="pl-s1">at</span>[<span class="pl-c1">0</span>,<span class="pl-c1">0</span>]
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 18:35:25.506088'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>.<span class="pl-s1">ix</span>[<span class="pl-c1">0</span>,<span class="pl-c1">0</span>]
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 18:35:25.506088'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>.<span class="pl-s1">ix</span>[<span class="pl-c1">0</span>]
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 14:35:25.506088-0400'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-240)'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>[<span class="pl-c1">0</span>].<span class="pl-s1">at</span>[<span class="pl-c1">0</span>]
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 14:35:25.506088-0400'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-240)'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>[<span class="pl-c1">0</span>].<span class="pl-s1">ix</span>[<span class="pl-c1">0</span>]
<span class="pl-v">Timestamp</span>(<span class="pl-s">'2016-03-30 14:35:25.506088-0400'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-240)'</span>)</pre></div>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">I'd expect <code class="notranslate">df.at[0,0]</code> and <code class="notranslate">df.ix[0,0]</code> to show the same timezone-aware timestamps as the other indexing methods.</p>
<h4 dir="auto">output of <code class="notranslate">pd.show_versions()</code></h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import pandas as pd
&gt;&gt;&gt; pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.18.12-el6.ia32e.lime.0
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.18.0
nose: None
pip: 7.1.0
setuptools: 19.4
Cython: None
numpy: 1.11.0
scipy: None
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">pd</span>.<span class="pl-en">show_versions</span>()

<span class="pl-v">INSTALLED</span> <span class="pl-v">VERSIONS</span>
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span>
<span class="pl-s1">commit</span>: <span class="pl-c1">None</span>
<span class="pl-s1">python</span>: <span class="pl-c1">2.7</span>.<span class="pl-c1">6.</span><span class="pl-s1">final</span>.<span class="pl-c1">0</span>
<span class="pl-s1">python</span><span class="pl-c1">-</span><span class="pl-s1">bits</span>: <span class="pl-c1">64</span>
<span class="pl-v">OS</span>: <span class="pl-v">Linux</span>
<span class="pl-v">OS</span><span class="pl-c1">-</span><span class="pl-s1">release</span>: <span class="pl-c1">3.18</span><span class="pl-c1">.12</span><span class="pl-c1">-</span><span class="pl-s1">el6</span>.<span class="pl-s1">ia32e</span>.<span class="pl-s1">lime</span>.<span class="pl-c1">0</span>
<span class="pl-s1">machine</span>: <span class="pl-s1">x86_64</span>
<span class="pl-s1">processor</span>: <span class="pl-s1">x86_64</span>
<span class="pl-s1">byteorder</span>: <span class="pl-s1">little</span>
<span class="pl-v">LC_ALL</span>: <span class="pl-c1">None</span>
<span class="pl-v">LANG</span>: <span class="pl-s1">en_US</span>.<span class="pl-v">UTF</span><span class="pl-c1">-</span><span class="pl-c1">8</span>

<span class="pl-s1">pandas</span>: <span class="pl-c1">0.18</span>.<span class="pl-c1">0</span>
<span class="pl-s1">nose</span>: <span class="pl-c1">None</span>
<span class="pl-s1">pip</span>: <span class="pl-c1">7.1</span>.<span class="pl-c1">0</span>
<span class="pl-s1">setuptools</span>: <span class="pl-c1">19.4</span>
<span class="pl-v">Cython</span>: <span class="pl-c1">None</span>
<span class="pl-s1">numpy</span>: <span class="pl-c1">1.11</span>.<span class="pl-c1">0</span>
<span class="pl-s1">scipy</span>: <span class="pl-c1">None</span>
<span class="pl-s1">statsmodels</span>: <span class="pl-c1">None</span>
<span class="pl-s1">xarray</span>: <span class="pl-c1">None</span>
<span class="pl-v">IPython</span>: <span class="pl-c1">None</span>
<span class="pl-s1">sphinx</span>: <span class="pl-c1">None</span>
<span class="pl-s1">patsy</span>: <span class="pl-c1">None</span>
<span class="pl-s1">dateutil</span>: <span class="pl-c1">2.5</span>.<span class="pl-c1">2</span>
<span class="pl-s1">pytz</span>: <span class="pl-c1">2016.3</span>
<span class="pl-s1">blosc</span>: <span class="pl-c1">None</span>
<span class="pl-s1">bottleneck</span>: <span class="pl-c1">None</span>
<span class="pl-s1">tables</span>: <span class="pl-c1">None</span>
<span class="pl-s1">numexpr</span>: <span class="pl-c1">None</span>
<span class="pl-s1">matplotlib</span>: <span class="pl-c1">None</span>
<span class="pl-s1">openpyxl</span>: <span class="pl-c1">None</span>
<span class="pl-s1">xlrd</span>: <span class="pl-c1">None</span>
<span class="pl-s1">xlwt</span>: <span class="pl-c1">None</span>
<span class="pl-s1">xlsxwriter</span>: <span class="pl-c1">None</span>
<span class="pl-s1">lxml</span>: <span class="pl-c1">None</span>
<span class="pl-s1">bs4</span>: <span class="pl-c1">None</span>
<span class="pl-s1">html5lib</span>: <span class="pl-c1">None</span>
<span class="pl-s1">httplib2</span>: <span class="pl-c1">None</span>
<span class="pl-s1">apiclient</span>: <span class="pl-c1">None</span>
<span class="pl-s1">sqlalchemy</span>: <span class="pl-c1">1.0</span>.<span class="pl-c1">12</span>
<span class="pl-s1">pymysql</span>: <span class="pl-c1">None</span>
<span class="pl-s1">psycopg2</span>: <span class="pl-c1">None</span>
<span class="pl-s1">jinja2</span>: <span class="pl-c1">2.8</span>
<span class="pl-s1">boto</span>: <span class="pl-c1">None</span></pre></div>
<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="data = {'name':['John', 'Anderson'], 'date':[pd.Timestamp(2017,3,13,13,32,56), pd.Timestamp(2017,2,16,12,10,3)]}
test_df = pd.DataFrame(data=data)
test_df['date'] = test_df['date'].map(lambda x:x.tz_localize('Asia/Shanghai'))

In [18]: test_df.at[0,'date']
Out[18]: Timestamp('2017-03-13 05:32:56')

In [19]: test_df.loc[0,'date']
Out[19]: Timestamp('2017-03-13 13:32:56+0800', tz='Asia/Shanghai')"><pre class="notranslate"><code class="notranslate">data = {'name':['John', 'Anderson'], 'date':[pd.Timestamp(2017,3,13,13,32,56), pd.Timestamp(2017,2,16,12,10,3)]}
test_df = pd.DataFrame(data=data)
test_df['date'] = test_df['date'].map(lambda x:x.tz_localize('Asia/Shanghai'))

In [18]: test_df.at[0,'date']
Out[18]: Timestamp('2017-03-13 05:32:56')

In [19]: test_df.loc[0,'date']
Out[19]: Timestamp('2017-03-13 13:32:56+0800', tz='Asia/Shanghai')
</code></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">The sample code is as above.<br>
I have a column in DataFrame that contains the datetime values which are Timestamp object in pandas.<br>
After I localise the timestamp, while using .at getter and .loc getter, I get different results.<br>
One is without time zone info, the other is with time zone info.</p>
<p dir="auto">Is this a bug? How can I get the timestamp with time zone info using ".at" getter?</p>
<h4 dir="auto">Expected Output</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test_df.at[0,'date']
Timestamp('2017-03-13 13:32:56+0800', tz='Asia/Shanghai')"><pre class="notranslate"><code class="notranslate">test_df.at[0,'date']
Timestamp('2017-03-13 13:32:56+0800', tz='Asia/Shanghai')
</code></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
# Paste the output here pd.show_versions() here
<p dir="auto">In [20]: pd.show_versions()</p>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 2.7.6.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 3.19.0-66-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_HK.UTF-8<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.19.2<br>
nose: 1.3.7<br>
pip: 9.0.1<br>
setuptools: 25.1.1<br>
Cython: 0.24.1<br>
numpy: 1.12.1<br>
scipy: 0.18.1<br>
statsmodels: None<br>
xarray: None<br>
IPython: 5.0.0<br>
sphinx: None<br>
patsy: None<br>
dateutil: 2.6.0<br>
pytz: 2016.10<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
matplotlib: 1.5.1<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: 0.999<br>
httplib2: 0.8<br>
apiclient: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: None<br>
boto: None<br>
pandas_datareader: None</p>
</details>