title: Asigning value to an object in python
body: <p>I am trying to assign 1 and 0 to a column in a data-frame which is actually a string. In the below dateset 'abc' is to be 1 and rest should be 0</p>
  <p>Below is the sample datasest:</p>
  <pre><code>type={'type':['abc','abc','kk','arr','yg','np']}
  df=pd.DataFrame(type,columns=['type'])
  </code></pre>
  <p>My code:</p>
  <pre><code>df['new']=np.where(df['type']=='abd',1,0)
  df['new'].value_counts()
  </code></pre>
  <p>Output:</p>
  <pre><code>0    6
  Name: new, dtype: int64
  </code></pre>