title: Problem with pandas.Series.cat.rename_categories - getting 'categories must be unique' error
body: <p>Am new to Python and working through some exercises.</p>
  <p>I have a column in my data called 'sequels' (for books) with numbers 1 through to 8.</p>
  <p>I want to make a new column called 'sequelcategory' which relabels the numbers - I want 1 to be renamed to 'Original' and anything else to be renamed to Sequel. The exercise suggests that I use &quot;pd.Series.cat.rename_categories&quot; to do this.</p>
  <p>The first hurdle I overcame was beating an error that said I needed to have categorical data (it was initially int64), I did this with:</p>
  <pre><code>bookdata['sequels'] = bookdata['sequels'].astype('category')
  </code></pre>
  <p>That was all well and good. I think set to creating my new column:</p>
  <pre><code>bookdata[&quot;sequelcategory&quot;] = bookdata[&quot;sequels&quot;].cat.rename_categories({1: 'original', 2: 'sequel'})
  </code></pre>
  <p>The above works absolutely fine - the problem I am having is that I also want numbers 3 - 8 to also be relabelled 'sequel', meaning that the below:</p>
  <pre><code>bookdata[&quot;sequelcategory&quot;] = bookdata[&quot;sequels&quot;].cat.rename_categories({1: 'original', 2: 'sequel', 3: 'sequel', 4: 'sequel', 5: 'sequel', 6: 'sequel', 7: 'sequel', 8: 'sequel', })
  </code></pre>
  <p>...returns the error: ValueError: Categorical categories must be unique.</p>
  <p>Anyone have some advice on the above? I know there are probably 101 other ways to do this, but I am being told I need to do it with <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.rename_categories.html" rel="nofollow noreferrer">pandas.Series.cat.rename_categories</a> and can't for the life of me work it out.</p>
  <p>Any help would be greatly appreciated!</p>