title: Python combine map with groupby and transform
body: <p>I'm having trouble combining a couple concepts in Python; groupby, map, and transform.  I have a dataframe where I'm looking to create a new column by transforming an existing one based on a group. Like this:</p>
  
  <pre><code>s = df[df['type'].eq('office')].groupby(['user','date']).transform('any')
  df.loc[:,'type2'] = df['type'].s.map({True:'office',False:'remote'})
  </code></pre>
  
  <p>So my dataframe would look like this </p>
  
  <pre><code>user     date    type   type2
  ron     12/1/19  office  office
  ron     12/1/19  remote  office
  april   12/1/19  office  office
  leslie  12/1/19  remote  office
  leslie  12/1/19  office  office
  leslie  2/1/20   office  office
  </code></pre>
  
  <p>But I get the following error :</p>
  
  <pre><code>AttributeError: 'Series' object has no attribute 's'
  </code></pre>
  
  <p>I thought I set this up properly but having trouble getting it to work. Guidance appreciated thank you</p>