title: What binning or group technique is this of Python or Pandas
body: <p>I'm fairly new to Pandas and I understand to handle data it is often a good practice to in them, create dummy variables or even create new columns in the DataFrame.
  However I came across these lines of code and cannot understand what it does. It was intended to group  data of1 categorical column into 3 columns by age.</p>
  <pre class="lang-py prettyprint-override"><code>ratings_df.loc[(ratings_df['age'] &lt;= 40), 'age_group'] = '40 years and younger'
  ratings_df.loc[(ratings_df['age'] &gt; 40) &amp; (ratings_df['age'] &lt; 57), 'age_group'] = 'between 40 and 57 years'
  ratings_df.loc[(ratings_df['age'] &gt;= 57), 'age_group'] = '57 years and older'
  </code></pre>
  <p>It doesn't create a new column, or a new Dataframe by given name. But it's later used to train data in a regression model with another independent variable 'beauty'</p>
  <pre><code>lm = ols('beauty ~ age_group', data = ratings_df).fit()
  </code></pre>
  <p>What does it do?</p>