How to look up rows in certain condition
<p>I have a dataframe and I would like to search strange rows like below :</p>

<pre><code>ããmonth
0  201605ãããã
1  201606
2  201607
3      08
4     nan
5  201610
</code></pre>

<p>For instance, I would like to extract rows with elements that is not 6 digits like below :</p>

<pre><code>   month
3   08
4  nan
</code></pre>

<p>I have searched, but couldn't figure out how to extract rows.
How can I get this result?</p>

<p>Suppose your month column is of <code>str</code> type, you can use <code>.str.len()</code> to get the number of digits for each element and use the result for subsetting:</p>

<pre><code>df[df.month.str.len() != 6]

# month
#3   08
#4  NaN
</code></pre>

python pandas dataframe