<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="# Your code here
"><pre class="notranslate"><span class="pl-c"># Your code here</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">[this should explain <strong>why</strong> the current behaviour is a problem and why the expected output is a better solution.]</p>
<p dir="auto"><strong>Note</strong>: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!</p>
<p dir="auto"><strong>Note</strong>: Many problems can be resolved by simply upgrading <code class="notranslate">pandas</code> to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if <code class="notranslate">master</code> addresses this issue, but that is not necessary.</p>
<p dir="auto">For documentation-related issues, you can check the latest versions of the docs on <code class="notranslate">master</code> here:</p>
<p dir="auto"><a href="https://pandas-docs.github.io/pandas-docs-travis/" rel="nofollow">https://pandas-docs.github.io/pandas-docs-travis/</a></p>
<p dir="auto">If the issue has not been resolved there, go ahead and file it in the issue tracker.</p>
<h4 dir="auto">Expected Output</h4>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<p dir="auto">[paste the output of <code class="notranslate">pd.show_versions()</code> here below this line]</p>
</details>
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<p dir="auto">When localizing a Timestamp vs timeseries/index, the timezones look similar</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [21]: ts = pd.Timestamp('2012-01-01').tz_localize('US/Eastern')

In [22]: dtidx = pd.to_datetime(['2012-01-01']).tz_localize('US/Eastern')

In [23]: ts
Out[23]: Timestamp('2012-01-01 00:00:00-0500', tz='US/Eastern')

In [24]: dtidx
Out[24]: DatetimeIndex(['2012-01-01 00:00:00-05:00'], dtype='datetime64[ns, US/Eastern]', freq=None)

In [25]: dtidx[0]
Out[25]: Timestamp('2012-01-01 00:00:00-0500', tz='US/Eastern')
"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">21</span>]: <span class="pl-s1">ts</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Timestamp</span>(<span class="pl-s">'2012-01-01'</span>).<span class="pl-en">tz_localize</span>(<span class="pl-s">'US/Eastern'</span>)

<span class="pl-v">In</span> [<span class="pl-c1">22</span>]: <span class="pl-s1">dtidx</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>([<span class="pl-s">'2012-01-01'</span>]).<span class="pl-en">tz_localize</span>(<span class="pl-s">'US/Eastern'</span>)

<span class="pl-v">In</span> [<span class="pl-c1">23</span>]: <span class="pl-s1">ts</span>
<span class="pl-v">Out</span>[<span class="pl-c1">23</span>]: <span class="pl-v">Timestamp</span>(<span class="pl-s">'2012-01-01 00:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'US/Eastern'</span>)

<span class="pl-v">In</span> [<span class="pl-c1">24</span>]: <span class="pl-s1">dtidx</span>
<span class="pl-v">Out</span>[<span class="pl-c1">24</span>]: <span class="pl-v">DatetimeIndex</span>([<span class="pl-s">'2012-01-01 00:00:00-05:00'</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'datetime64[ns, US/Eastern]'</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-c1">None</span>)

<span class="pl-v">In</span> [<span class="pl-c1">25</span>]: <span class="pl-s1">dtidx</span>[<span class="pl-c1">0</span>]
<span class="pl-v">Out</span>[<span class="pl-c1">25</span>]: <span class="pl-v">Timestamp</span>(<span class="pl-s">'2012-01-01 00:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'US/Eastern'</span>)</pre></div>
<p dir="auto">but under the hood the <code class="notranslate">tz</code> attributes of the DatetimeIndex is actually different as the <code class="notranslate">tz</code> attribute of the actual Timestamps (even when accessing a single element of the DatetimeIndex as a Timestamp):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [26]: ts.tz
Out[26]: &lt;DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD&gt;

In [27]: dtidx.tz
Out[27]: &lt;DstTzInfo 'US/Eastern' LMT-1 day, 19:04:00 STD&gt;   &lt;-- note the difference here

In [28]: dtidx[0].tz
Out[28]: &lt;DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD&gt;

In [29]: ts.tz == dtidx.tz
Out[29]: False

In [30]: ts.tz.zone
Out[30]: 'US/Eastern'

In [31]: dtidx.tz.zone
Out[31]: 'US/Eastern'"><pre class="notranslate"><code class="notranslate">In [26]: ts.tz
Out[26]: &lt;DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD&gt;

In [27]: dtidx.tz
Out[27]: &lt;DstTzInfo 'US/Eastern' LMT-1 day, 19:04:00 STD&gt;   &lt;-- note the difference here

In [28]: dtidx[0].tz
Out[28]: &lt;DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD&gt;

In [29]: ts.tz == dtidx.tz
Out[29]: False

In [30]: ts.tz.zone
Out[30]: 'US/Eastern'

In [31]: dtidx.tz.zone
Out[31]: 'US/Eastern'
</code></pre></div>