<p dir="auto">I have some data that I have used to generate a stacked bar graph.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="by_conclusion = measles_data.groupby([&quot;AGE&quot;, &quot;CONCLUSION&quot;])
counts_by_cause = by_conclusion.size().unstack().fillna(0)
ax = counts_by_cause.plot(kind='bar', stacked=True)"><pre class="notranslate"><code class="notranslate">by_conclusion = measles_data.groupby(["AGE", "CONCLUSION"])
counts_by_cause = by_conclusion.size().unstack().fillna(0)
ax = counts_by_cause.plot(kind='bar', stacked=True)
</code></pre></div>
<p dir="auto">However, I get a pretty crowded x-axis:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/0849ca8448f46d8226f273d6168f4b6f21fa73bfecccca095b61c4a150a0cb83/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38313437362f3232393038302f32393633373938322d383639342d313165322d393662642d3234613936633365326463642e706e67"><img src="https://camo.githubusercontent.com/0849ca8448f46d8226f273d6168f4b6f21fa73bfecccca095b61c4a150a0cb83/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38313437362f3232393038302f32393633373938322d383639342d313165322d393662642d3234613936633365326463642e706e67" alt="too_many_ticks" data-canonical-src="https://f.cloud.github.com/assets/81476/229080/29637982-8694-11e2-96bd-24a96c3e2dcd.png" style="max-width: 100%;"></a></p>
<p dir="auto">So, I try to use <code class="notranslate">set_xticks</code> to try and thin them out, either as an argument to plot, or as a separate command:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ax.xticks(arange(0,80,10))"><pre class="notranslate"><code class="notranslate">ax.xticks(arange(0,80,10))
</code></pre></div>
<p dir="auto">However, for some reason, the labels end up being downscaled by a factor of 10:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/a07074debb63b1a01b1b4bb9f1906a4ef57a08a68514ed4c05c9706f558240f3/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38313437362f3232393038312f32626536626638652d383639342d313165322d386435632d3436323838363036643738352e706e67"><img src="https://camo.githubusercontent.com/a07074debb63b1a01b1b4bb9f1906a4ef57a08a68514ed4c05c9706f558240f3/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38313437362f3232393038312f32626536626638652d383639342d313165322d386435632d3436323838363036643738352e706e67" alt="wrong_ticks" data-canonical-src="https://f.cloud.github.com/assets/81476/229081/2be6bf8e-8694-11e2-8d5c-46288606d785.png" style="max-width: 100%;"></a></p>
<p dir="auto">(might be hard to see, but it is printing "0.0, 1.0, 2.0, ..." instead of "0, 10, 20, ...")</p>
<p dir="auto">Its not clear why this is happening, or how to get around it, so I'm either going about this wrong or its a bug. I get the same behavior when I try using <code class="notranslate">MaxNLocator</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ax.xaxis.set_major_locator( MaxNLocator(nbins = 7) )"><pre class="notranslate"><code class="notranslate">ax.xaxis.set_major_locator( MaxNLocator(nbins = 7) )
</code></pre></div>
<p dir="auto"><a href="https://dl.dropbox.com/u/233041/measles.csv" rel="nofollow">The data are here</a></p>
<p dir="auto">After a concat of two DataFrames with the same columns. I want to consolidate some data and remove NaNs in some columns by values in other columns. I ended up with a DataFrame that magically had additional columns.</p>
<p dir="auto">This is the minimum example that I can give to reproduce the faulty behaviour using current master (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/pandas-dev/pandas/commit/70de129e6017c73c8903268b30f5478e4ca7bc7f/hovercard" href="https://github.com/pandas-dev/pandas/commit/70de129e6017c73c8903268b30f5478e4ca7bc7f"><tt>70de129</tt></a>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df1 = pd.DataFrame([{'A':None, 'B':1},{'A':2, 'B':2}])
df2 = pd.DataFrame([{'A':3, 'B':3},{'A':4, 'B':4}])
df = pd.concat([df1, df2], axis=1)"><pre class="notranslate"><code class="notranslate">df1 = pd.DataFrame([{'A':None, 'B':1},{'A':2, 'B':2}])
df2 = pd.DataFrame([{'A':3, 'B':3},{'A':4, 'B':4}])
df = pd.concat([df1, df2], axis=1)
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; df1
    A  B
0 NaN  1
1   2  2

[2 rows x 2 columns]

&gt;&gt;&gt; df2
   A  B
0  3  3
1  4  4

[2 rows x 2 columns]

&gt;&gt;&gt; df
    A  B  A  B
0 NaN  1  3  3
1   2  2  4  4

[2 rows x 4 columns]"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; df1
    A  B
0 NaN  1
1   2  2

[2 rows x 2 columns]

&gt;&gt;&gt; df2
   A  B
0  3  3
1  4  4

[2 rows x 2 columns]

&gt;&gt;&gt; df
    A  B  A  B
0 NaN  1  3  3
1   2  2  4  4

[2 rows x 4 columns]
</code></pre></div>
<p dir="auto">Now replacing NaNs in the 0 column with (corresponding) values in the 2 column ('A'), I expected to simply write a 3 into NaN (which it did), but it actually added a column '0' at the end of the DataFrame even though iloc is not supposed to enlarge the dataset. Clearly a bug.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="inds = np.isnan(df.iloc[:, 0])
df.iloc[:, 0][inds] = df.iloc[:, 2][inds]"><pre class="notranslate"><code class="notranslate">inds = np.isnan(df.iloc[:, 0])
df.iloc[:, 0][inds] = df.iloc[:, 2][inds]
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; df
   A  B  A  B  0
0  3  1  3  3  3
1  2  2  4  4  2

[2 rows x 5 columns]"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; df
   A  B  A  B  0
0  3  1  3  3  3
1  2  2  4  4  2

[2 rows x 5 columns]
</code></pre></div>