title: type error with LabelEncoder.fit_transform()
body: <p>I was playing with the Titanic dataset on Kaggle (<a href="https://www.kaggle.com/c/titanic/data" rel="nofollow noreferrer">https://www.kaggle.com/c/titanic/data</a>), and I want to use LabelEncoder from sklearn.preprocessing to transform Sex, originally labeled as 'male' or 'female' into '0' or '1'. I had the following four lines of code,</p>
  
  <pre><code>import pandas as pd
  from sklearn.preprocessing import LabelEncoder
  df = pd.read_csv('titanic.csv')
  df['Sex'] = LabelEncoder.fit_transform(df['Sex'])  
  </code></pre>
  
  <p>But when I ran it I received the following error message: </p>
  
  <pre><code>TypeError: fit_transform() missing 1 required positional argument: 'y'
  </code></pre>
  
  <p>the error comes from line 4, i.e., </p>
  
  <pre><code>df['Sex'] = LabelEncoder.fit_transform(df['Sex']) 
  </code></pre>
  
  <p>I wonder what went wrong here. Although I know I could also do the transformation using map, which might be even simpler, but I still want to know what's wrong with my usage of LabelEncoder. </p>