title: How to findall() a sequence of regular expressions to a pandas dataframe?
body: <p>I am extracting some patterns with pandas <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.findall.html" rel="nofollow noreferrer">findall</a> function. However, I have several regular expressions. This, how can I <code>findall</code> <code>N</code> regular expressions with pandas?.</p>
  
  <p>For example, lets say that I would like to extract the all the numbers and all the dates inside an specific column:</p>
  
  <p>In:</p>
  
  <pre><code>dfs = pd.DataFrame(data={'c1': ['This dataset 11/12/98 contains 5,000 rows, which were sampled from a 500,000 11/12/12 row dataset spanning the same time period. Throughout these analyses', 
  
                                  'the number of events you count will be about 100 times smaller than they 11/12/78 actually were, but the 01/12/11 proportions of events will still generally be reflective that larger dataset. In this case, a sample is fine because our purpose is to learn methods of data analysis with Python, not to create 100% accurate recommendations to Watsi.']})
  
  dfs
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>    c1
  0   This dataset 11/12/98 contains 5,000 rows, whi...
  1   the number of events you count will be about 1...
  </code></pre>
  
  <p>I tried to, but I am getting the following error:</p>
  
  <p>In:</p>
  
  <pre><code>dfs['patterns'] = dfs['c1'].str.findall([r'\d+',r'(\d+/\d+/\d+)']).apply(', '.join)
  
  dfs
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-64-af2969e06a61&gt; in &lt;module&gt;()
  ----&gt; 1 dfs['patterns'] = dfs['c1'].str.findall([r'\d+',r'(\d+/\d+/\d+)']).apply(', '.join)
        2 dfs
  
  /usr/local/lib/python3.5/site-packages/pandas/core/strings.py in wrapper2(self, pat, flags, **kwargs)
     1268 
     1269     def wrapper2(self, pat, flags=0, **kwargs):
  -&gt; 1270         result = f(self._data, pat, flags=flags, **kwargs)
     1271         return self._wrap_result(result)
     1272 
  
  /usr/local/lib/python3.5/site-packages/pandas/core/strings.py in str_findall(arr, pat, flags)
      827     extractall : returns DataFrame with one column per capture group
      828     """
  --&gt; 829     regex = re.compile(pat, flags=flags)
      830     return _na_map(regex.findall, arr)
      831 
  
  /usr/local/Cellar/python3/3.5.2_2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/re.py in compile(pattern, flags)
      222 def compile(pattern, flags=0):
      223     "Compile a regular expression pattern, returning a pattern object."
  --&gt; 224     return _compile(pattern, flags)
      225 
      226 def purge():
  
  /usr/local/Cellar/python3/3.5.2_2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/re.py in _compile(pattern, flags)
      279     # internal: compile pattern
      280     try:
  --&gt; 281         p, loc = _cache[type(pattern), pattern, flags]
      282         if loc is None or loc == _locale.setlocale(_locale.LC_CTYPE):
      283             return p
  
  TypeError: unhashable type: 'list'
  </code></pre>
  
  <p>Therefore how can I "stack", "nest" or apply several regex with <code>findall</code> function?. <strong>What I expect as an output is the resolution of each regular expression separated by <code>,</code> in a single column</strong>:</p>
  
  <pre><code>   col
  0  '11/12/98', '5', '000', '500', '000', '11/12/12'
  1  '100', '11/12/78', '01/12/11', '100'
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I tried to:</p>
  
  <pre><code>dfs['patterns'] = dfs['c1'].str.map(findall(),[r'\d+',r'(\d+/\d+/\d+)']).apply(', '.join)
  dfs
  </code></pre>