title: Python - Splitting and replacing parts of a list with multiple replacements in a pandas dataframe
body: <p>In Python, I have a list of places in a pandas dataframe that I want to reduce each string to match the format of a larger list, with the goal of merging the lists.</p>
  <p>Ultimately, I want to make this list match the format of the other dataframe so that when I merge, I'm only merging rows where the &quot;stop_name&quot; column matches.</p>
  <p>For example, out of the list below, I want to remove &quot; STATION&quot;, so that &quot;BOONTON STATION&quot; becomes just &quot;BOONTON&quot;.</p>
  <p>However, I also want &quot;BUTLER STATON (NEW JERSEY)&quot; to become just &quot;BUTLER&quot;, removing &quot; STATION (NEW JERSEY)&quot;.</p>
  <p>Lastly, for a 2-word station name I want to keep the second word, so that &quot;MORRIS PLAINS STATION&quot; becomes just &quot;MORRIS PLAINS&quot;.</p>
  <p><strong>Basically I want to remove everything from one space from before the word &quot;station&quot; and everything after it on every row in the “stop_name” column.</strong></p>
  <p>I've tried various splits and replacements of strings and I'm either getting errors, or it's not making the replacement on every row.</p>
  <p>Any direction to a viable solution would be appreciated.</p>
  <pre><code>stop_name
  0   BOONTON STATION
  1   BUTLER STATION (NEW JERSEY)
  2   CONVENT STATION (NJ TRANSIT)
  3   DOVER STATION (NJ TRANSIT)
  4   LAKE HOPATCONG STATION
  5   MADISON STATION (NJ TRANSIT)
  6   MILLINGTON STATION
  7   MORRIS PLAINS STATION
  8   MORRISTOWN STATION
  9   MOUNT ARLINGTON STATION
  10  MOUNT TABOR STATION
  12  POMPTON PLAINS STATION
  13  TOWACO STATION
  </code></pre>