title: Create a day-of-week column in a Pandas dataframe using Python
body: <p>Create a day-of-week column in a Pandas dataframe using Python</p>
  
  <p>I’d like to read a csv file into a pandas dataframe, parse a column of dates from string format to a date object, and then generate a new column that indicates the day of the week.</p>
  
  <p>This is what I’m trying:</p>
  
  <p>What I’d like to do is something like:</p>
  
  <pre><code>import pandas as pd
  
  import csv
  
  df = pd.read_csv('data.csv', parse_dates=['date']))
  
  df['day-of-week'] = df['date'].weekday()
  
  
  AttributeError: 'Series' object has no attribute 'weekday'
  </code></pre>
  
  <hr>
  
  <p>Thank you for your help.
  James</p>