<p dir="auto">Duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="49945943" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/8890" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/8890/hovercard" href="https://github.com/pandas-dev/pandas/issues/8890">#8890</a>.</p>
<p dir="auto">As far as I can tell, the Timestamps for the index generated by <code class="notranslate">iterrows()</code> are 5 hours behind where they should be in this example:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [33]: idx = pd.date_range(&quot;2010-01-01 00:00:00-0500&quot;, freq='D', periods=3)

In [34]: df = pd.DataFrame([1,2,3], index=[idx])

In [35]: df # this looks correct
Out[35]: 
                           0
2010-01-01 00:00:00-05:00  1
2010-01-02 00:00:00-05:00  2
2010-01-03 00:00:00-05:00  3

In [36]: [index for index, row in df.iterrows()] # but this looks wrong:
Out[36]: 
[Timestamp('2009-12-31 19:00:00-0500', tz='pytz.FixedOffset(-300)', offset='D'),
 Timestamp('2010-01-01 19:00:00-0500', tz='pytz.FixedOffset(-300)', offset='D'),
 Timestamp('2010-01-02 19:00:00-0500', tz='pytz.FixedOffset(-300)', offset='D')]"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">33</span>]: <span class="pl-s1">idx</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">"2010-01-01 00:00:00-0500"</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">3</span>)

<span class="pl-v">In</span> [<span class="pl-c1">34</span>]: <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>([<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-s1">idx</span>])

<span class="pl-v">In</span> [<span class="pl-c1">35</span>]: <span class="pl-s1">df</span> <span class="pl-c"># this looks correct</span>
<span class="pl-v">Out</span>[<span class="pl-c1">35</span>]: 
                           <span class="pl-c1">0</span>
<span class="pl-c1">2010</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">01</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">05</span>:<span class="pl-c1">00</span>  <span class="pl-c1">1</span>
<span class="pl-c1">2010</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">02</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">05</span>:<span class="pl-c1">00</span>  <span class="pl-c1">2</span>
<span class="pl-c1">2010</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">03</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">05</span>:<span class="pl-c1">00</span>  <span class="pl-c1">3</span>

<span class="pl-v">In</span> [<span class="pl-c1">36</span>]: [<span class="pl-s1">index</span> <span class="pl-k">for</span> <span class="pl-s1">index</span>, <span class="pl-s1">row</span> <span class="pl-c1">in</span> <span class="pl-s1">df</span>.<span class="pl-en">iterrows</span>()] <span class="pl-c"># but this looks wrong:</span>
<span class="pl-v">Out</span>[<span class="pl-c1">36</span>]: 
[<span class="pl-v">Timestamp</span>(<span class="pl-s">'2009-12-31 19:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-300)'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>),
 <span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-01 19:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-300)'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>),
 <span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-02 19:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-300)'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>)]</pre></div>
<p dir="auto">I would have expected <code class="notranslate">iterrows()</code> to produce the same indices as this code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [38]: [df.index[i] for i in range(len(df))]
Out[38]: 
[Timestamp('2010-01-01 00:00:00-0500', tz='pytz.FixedOffset(-300)', offset='D'),
 Timestamp('2010-01-02 00:00:00-0500', tz='pytz.FixedOffset(-300)', offset='D'),
 Timestamp('2010-01-03 00:00:00-0500', tz='pytz.FixedOffset(-300)', offset='D')]"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">38</span>]: [<span class="pl-s1">df</span>.<span class="pl-s1">index</span>[<span class="pl-s1">i</span>] <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-en">len</span>(<span class="pl-s1">df</span>))]
<span class="pl-v">Out</span>[<span class="pl-c1">38</span>]: 
[<span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-01 00:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-300)'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>),
 <span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-02 00:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-300)'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>),
 <span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-03 00:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-300)'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>)]</pre></div>
<p dir="auto">The <code class="notranslate">row.name</code> is also incorrect:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [37]: [row.name for index, row in df.iterrows()]
Out[37]: 
[Timestamp('2009-12-31 19:00:00-0500', tz='pytz.FixedOffset(-300)', offset='D'),
 Timestamp('2010-01-01 19:00:00-0500', tz='pytz.FixedOffset(-300)', offset='D'),
 Timestamp('2010-01-02 19:00:00-0500', tz='pytz.FixedOffset(-300)', offset='D')]"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">37</span>]: [<span class="pl-s1">row</span>.<span class="pl-s1">name</span> <span class="pl-k">for</span> <span class="pl-s1">index</span>, <span class="pl-s1">row</span> <span class="pl-c1">in</span> <span class="pl-s1">df</span>.<span class="pl-en">iterrows</span>()]
<span class="pl-v">Out</span>[<span class="pl-c1">37</span>]: 
[<span class="pl-v">Timestamp</span>(<span class="pl-s">'2009-12-31 19:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-300)'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>),
 <span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-01 19:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-300)'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>),
 <span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-02 19:00:00-0500'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'pytz.FixedOffset(-300)'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>)]</pre></div>
<p dir="auto">But all is fine if we use a geographical timezone instead of a <code class="notranslate">pytz.FixedOffset</code>:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
In [47]: idx = pd.date_range(&quot;2010-01-01 00:00:00&quot;, freq='D', periods=3, tz=&quot;America/New_York&quot;)

In [48]: df = pd.DataFrame([1,2,3], index=[idx])

In [49]: [index for index, row in df.iterrows()]
Out[49]: 
[Timestamp('2010-01-01 00:00:00-0456', tz='America/New_York', offset='D'),
 Timestamp('2010-01-02 00:00:00-0456', tz='America/New_York', offset='D'),
 Timestamp('2010-01-03 00:00:00-0456', tz='America/New_York', offset='D')]

In [50]: df
Out[50]: 
                           0
2010-01-01 00:00:00-04:56  1
2010-01-02 00:00:00-04:56  2
2010-01-03 00:00:00-04:56  3"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">47</span>]: <span class="pl-s1">idx</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">"2010-01-01 00:00:00"</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">"America/New_York"</span>)

<span class="pl-v">In</span> [<span class="pl-c1">48</span>]: <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>([<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-s1">idx</span>])

<span class="pl-v">In</span> [<span class="pl-c1">49</span>]: [<span class="pl-s1">index</span> <span class="pl-k">for</span> <span class="pl-s1">index</span>, <span class="pl-s1">row</span> <span class="pl-c1">in</span> <span class="pl-s1">df</span>.<span class="pl-en">iterrows</span>()]
<span class="pl-v">Out</span>[<span class="pl-c1">49</span>]: 
[<span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-01 00:00:00-0456'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'America/New_York'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>),
 <span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-02 00:00:00-0456'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'America/New_York'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>),
 <span class="pl-v">Timestamp</span>(<span class="pl-s">'2010-01-03 00:00:00-0456'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'America/New_York'</span>, <span class="pl-s1">offset</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>)]

<span class="pl-v">In</span> [<span class="pl-c1">50</span>]: <span class="pl-s1">df</span>
<span class="pl-v">Out</span>[<span class="pl-c1">50</span>]: 
                           <span class="pl-c1">0</span>
<span class="pl-c1">2010</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">01</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">04</span>:<span class="pl-c1">56</span>  <span class="pl-c1">1</span>
<span class="pl-c1">2010</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">02</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">04</span>:<span class="pl-c1">56</span>  <span class="pl-c1">2</span>
<span class="pl-c1">2010</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">03</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00</span><span class="pl-c1">-</span><span class="pl-c1">04</span>:<span class="pl-c1">56</span>  <span class="pl-c1">3</span></pre></div>
<p dir="auto">Forgive me if I am using Pandas incorrectly!</p>
<p dir="auto">Versions:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
In [51]: pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.8.final.0
python-bits: 64
OS: Linux
OS-release: 3.16.0-25-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8

pandas: 0.15.1
nose: 1.3.4
Cython: 0.21.1
numpy: 1.8.2
scipy: 0.14.0
statsmodels: None
IPython: 2.3.1
sphinx: 1.2.3
patsy: None
dateutil: 2.2
pytz: 2014.10
bottleneck: 0.6.0
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.2
openpyxl: 1.8.6
xlrd: 0.9.2
xlwt: 0.7.5
xlsxwriter: None
lxml: 3.3.6
bs4: None
html5lib: 0.999
httplib2: 0.9
apiclient: None
rpy2: 2.3.8
sqlalchemy: None
pymysql: None
psycopg2: None"><pre class="notranslate"><code class="notranslate">
In [51]: pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.8.final.0
python-bits: 64
OS: Linux
OS-release: 3.16.0-25-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8

pandas: 0.15.1
nose: 1.3.4
Cython: 0.21.1
numpy: 1.8.2
scipy: 0.14.0
statsmodels: None
IPython: 2.3.1
sphinx: 1.2.3
patsy: None
dateutil: 2.2
pytz: 2014.10
bottleneck: 0.6.0
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.2
openpyxl: 1.8.6
xlrd: 0.9.2
xlwt: 0.7.5
xlsxwriter: None
lxml: 3.3.6
bs4: None
html5lib: 0.999
httplib2: 0.9
apiclient: None
rpy2: 2.3.8
sqlalchemy: None
pymysql: None
psycopg2: None
</code></pre></div>
<p dir="auto">(it goes without saying that I'm a huge fan of Pandas!)</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="data = data.sortlevel()
print(data.loc[(&quot;STW AU Equity&quot;, &quot;2014-04-29&quot;), &quot;split&quot;])
data.loc[(&quot;STW AU Equity&quot;, &quot;2014-04-29&quot;), &quot;split&quot;] = 1
print(data.loc[(&quot;STW AU Equity&quot;, &quot;2014-04-29&quot;), &quot;split&quot;])

# result
1.0
symbol         date      
STW AU Equity  2014-04-29    1
               2014-04-29    1"><pre class="notranslate"><span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-s1">data</span>.<span class="pl-en">sortlevel</span>()
<span class="pl-en">print</span>(<span class="pl-s1">data</span>.<span class="pl-s1">loc</span>[(<span class="pl-s">"STW AU Equity"</span>, <span class="pl-s">"2014-04-29"</span>), <span class="pl-s">"split"</span>])
<span class="pl-s1">data</span>.<span class="pl-s1">loc</span>[(<span class="pl-s">"STW AU Equity"</span>, <span class="pl-s">"2014-04-29"</span>), <span class="pl-s">"split"</span>] <span class="pl-c1">=</span> <span class="pl-c1">1</span>
<span class="pl-en">print</span>(<span class="pl-s1">data</span>.<span class="pl-s1">loc</span>[(<span class="pl-s">"STW AU Equity"</span>, <span class="pl-s">"2014-04-29"</span>), <span class="pl-s">"split"</span>])

<span class="pl-c"># result</span>
<span class="pl-c1">1.0</span>
<span class="pl-s1">symbol</span>         <span class="pl-s1">date</span>      
<span class="pl-v">STW</span> <span class="pl-v">AU</span> <span class="pl-v">Equity</span>  <span class="pl-c1">2014</span><span class="pl-c1">-</span><span class="pl-c1">04</span><span class="pl-c1">-</span><span class="pl-c1">29</span>    <span class="pl-c1">1</span>
               <span class="pl-c1">2014</span><span class="pl-c1">-</span><span class="pl-c1">04</span><span class="pl-c1">-</span><span class="pl-c1">29</span>    <span class="pl-c1">1</span></pre></div>
<p dir="auto">Is there something I'm doing wrong, or is Pandas duplicating the value instead of updating it? If there's nothing obvious - I'll break out into a self-contained example.</p>