title: How to create new column based on multiple conditions from existing column pandas
body: <p>So I have a df column of 9 digit IDs.  There are no duplicates and each ID starts with a different number that ranges from 1-6 -- depending on the number each ID starts with I want to create a separate column with the "name" that the first number of the ID represents.  (e.g. IDs that start with 1 represent Maine, IDs that start with 2 represent California... and so on)</p>
  
  <p>This works if it was only 2 conditions: </p>
  
  <pre><code>df['id_label'] = ['name_1' if name.startswith('1') else 'everything_else' for name in df['col_1']]
  </code></pre>
  
  <p>I couldn't figure out how to create a multi line line comprehension for what I need so I thought this would work, but it only creates the <code>id_label</code> column from the last iteration of the loop (i.e. the <code>id_label</code> column will only contain <code>'name_5</code>):</p>
  
  <pre><code>for col in df['col_1']:
      if col.startswith('1'):
          df['id_label'] = 'name_1'
      if col.startswith('2'):
          df['id_label'] = 'name_2'
      if col.startswith('3'):
         df['id_label'] = 'name_3'
      if col.startswith('4'):
          df['id_label'] = 'name_4'
      if col.startswith('5'):
          df['id_label'] = 'name_5'
      if col.startswith('6'):
          df['id_label'] = 'name_5'
  </code></pre>
  
  <p>My question is how can I create a new column from an old column based on multiple conditional statements? </p>