<p dir="auto">Hypothesis recently added support for generating pandas objects: <a href="http://hypothesis.readthedocs.io/en/latest/numpy.html#pandas" rel="nofollow">http://hypothesis.readthedocs.io/en/latest/numpy.html#pandas</a></p>
<p dir="auto">This could be useful for testing some of the higher-level methods like <code class="notranslate">melt</code>, <code class="notranslate">merge</code>, etc.</p>
<p dir="auto">Are there any objections to adding some hypothesis-based tests to our test suite? Is anyone familiar with hypothesis and interested in putting together examples of how we could use it?</p>
<p dir="auto">Code Snippet</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="df = pd.DataFrame({&quot;id&quot;:[1,2,3,4,5,6], &quot;raw_grade&quot;:['a', 'b', 'b', 'a', 'a', 'e']})
df['grade'] = pd.Categorical(df['raw_grade'])
for t in df.itertuples(index=False):
    print(t)"><pre class="notranslate"><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-s">"id"</span>:[<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>,<span class="pl-c1">4</span>,<span class="pl-c1">5</span>,<span class="pl-c1">6</span>], <span class="pl-s">"raw_grade"</span>:[<span class="pl-s">'a'</span>, <span class="pl-s">'b'</span>, <span class="pl-s">'b'</span>, <span class="pl-s">'a'</span>, <span class="pl-s">'a'</span>, <span class="pl-s">'e'</span>]})
<span class="pl-s1">df</span>[<span class="pl-s">'grade'</span>] <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Categorical</span>(<span class="pl-s1">df</span>[<span class="pl-s">'raw_grade'</span>])
<span class="pl-k">for</span> <span class="pl-s1">t</span> <span class="pl-c1">in</span> <span class="pl-s1">df</span>.<span class="pl-en">itertuples</span>(<span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-c1">False</span>):
    <span class="pl-en">print</span>(<span class="pl-s1">t</span>)</pre></div>
<p dir="auto">Error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-45-182b29164b1a&gt; in &lt;module&gt;()
      1 df = pd.DataFrame({&quot;id&quot;:[1,2,3,4,5,6], &quot;raw_grade&quot;:['a', 'b', 'b', 'a', 'a', 'e']})
      2 df['grade'] = pd.Categorical(df['raw_grade'])
----&gt; 3 for t in df.itertuples(index=False):
      4     print(t)

/home/has2k1/scm/pandas/pandas/core/frame.pyc in itertuples(self, index)
    549         # use integer indexing because of possible duplicate column names
    550         arrays.extend(self.iloc[:, k] for k in range(len(self.columns)))
--&gt; 551         return zip(*arrays)
    552 
    553     if compat.PY3:  # pragma: no cover

TypeError: izip argument #3 must support iteration"><pre class="notranslate"><code class="notranslate">---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-45-182b29164b1a&gt; in &lt;module&gt;()
      1 df = pd.DataFrame({"id":[1,2,3,4,5,6], "raw_grade":['a', 'b', 'b', 'a', 'a', 'e']})
      2 df['grade'] = pd.Categorical(df['raw_grade'])
----&gt; 3 for t in df.itertuples(index=False):
      4     print(t)

/home/has2k1/scm/pandas/pandas/core/frame.pyc in itertuples(self, index)
    549         # use integer indexing because of possible duplicate column names
    550         arrays.extend(self.iloc[:, k] for k in range(len(self.columns)))
--&gt; 551         return zip(*arrays)
    552 
    553     if compat.PY3:  # pragma: no cover

TypeError: izip argument #3 must support iteration
</code></pre></div>
<p dir="auto">This is on master at commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/pandas-dev/pandas/commit/24b309f5a9bdf910f6424df98149f4601c0efd36/hovercard" href="https://github.com/pandas-dev/pandas/commit/24b309f5a9bdf910f6424df98149f4601c0efd36"><tt>24b309f</tt></a>.</p>
<p dir="auto">Edit:<br>
Version string - pandas: 0.14.1-78-g24b309f</p>