title: How can I split a text from a parenthesis in a CSV, and create another column with it
body: <p>I'm completely new to the Python world, so I've been struggling with this issue for a couple days now. I thank you guys in advance.</p>
  
  <p>I have been trying to separate a single Row and column text in three diferente ones. To explain myself better, here's where I am.</p>
  
  <p>So this is my pandas dataframe from a csv:</p>
  
  <p>In[2]:</p>
  
  <pre><code>df = pd.read_csv('raw_csv/consejo_judicatura_guerrero.csv', header=None)
  df.columns = ["institution"]
  df
  </code></pre>
  
  <p>Out[2]:</p>
  
  <pre><code>       institution 
  0      1.1.2. Consejo Nacional de Ciencias (CNCOO00012)     
  </code></pre>
  
  <p>Then, I try first to separate the <strong>1.1.2.</strong> in a new column called <strong>number</strong>, which I kind of nailed it: </p>
  
  <p>In[3]:</p>
  
  <pre><code>new_df = pd.DataFrame(df['institution'].str.split('. ',1).tolist(),columns=['number', 'institution'])
  </code></pre>
  
  <p>Out[3]:</p>
  
  <pre><code>       number institution 
  0      1.1.2. Consejo Nacional de Ciencias (CNCOO00012)     
  </code></pre>
  
  <p>Finally, trying to split the <strong>(CNCOO00012)</strong> in a new column called <strong>unit_id</strong> I get the following: </p>
  
  <p>In[4]:</p>
  
  <pre><code>new_df['institution'] = pd.DataFrame(new_df['institution'].str.split('(').tolist(),columns=['institution', 'unit_id'])
  </code></pre>
  
  <p>Out[4]:</p>
  
  <pre><code>------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-24-70d13206881c&gt; in &lt;module&gt;
  ----&gt; 1 new_df['institution'] = pd.DataFrame(new_df['institution'].str.split('(').tolist(),columns=['institution', 'unit_id'])
  
  ~/opt/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
      472                     if is_named_tuple(data[0]) and columns is None:
      473                         columns = data[0]._fields
  --&gt; 474                     arrays, columns = to_arrays(data, columns, dtype=dtype)
      475                     columns = ensure_index(columns)
      476 
  
  ~/opt/anaconda3/lib/python3.7/site-packages/pandas/core/internals/construction.py in to_arrays(data, columns, coerce_float, dtype)
      459         return [], []  # columns if columns is not None else []
      460     if isinstance(data[0], (list, tuple)):
  --&gt; 461         return _list_to_arrays(data, columns, coerce_float=coerce_float, dtype=dtype)
      462     elif isinstance(data[0], abc.Mapping):
      463         return _list_of_dict_to_arrays(
  
  ~/opt/anaconda3/lib/python3.7/site-packages/pandas/core/internals/construction.py in _list_to_arrays(data, columns, coerce_float, dtype)
      491     else:
      492         # list of lists
  --&gt; 493         content = list(lib.to_object_array(data).T)
      494     # gh-26429 do not raise user-facing AssertionError
      495     try:
  
  pandas/_libs/lib.pyx in pandas._libs.lib.to_object_array()
  
  TypeError: object of type 'NoneType' has no len()
  </code></pre>
  
  <p>What can I do to successfully achieve this task? </p>