title: How to count variable in one dataframe base on another dataframe?
body: <p>I have two df one called 'order' and another called 'asian_food'. Two table have a common column 'product_id'. I want to know how many time each of the product in the 'asian_food' table was ordered in the 'order' table.</p>
  <p>'order' table:</p>
  <p><a href="https://i.stack.imgur.com/8IsNo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8IsNo.png" alt="order" /></a></p>
  <p>'asian_food' table:</p>
  <p><a href="https://i.stack.imgur.com/tu6r1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tu6r1.png" alt="asian_food" /></a></p>
  <p>I've tried the following code:</p>
  <pre><code>asian['frequency'] = asian['product_id'].map(order_copy['product_id'].value_counts()).fillna(0).astype(int)
  </code></pre>
  <p>but it returns a error saying:</p>
  <pre><code>SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame.Try using .loc[row_indexer,col_indexer] = value instead
  </code></pre>
  <p>How can I use .loc to get what I want? Thank you in advance.</p>