title: How to assign a list element with loc function in pandas df?
body: <p>I have a question regarding the <code>loc</code> function for my pandas DataFrame.
  First I want to check if the person is a student, then I would like to assign to first value of the list 'Course' for that specific student. The dataset is quite large so I would like to keep using the <code>loc</code> function.</p>
  <pre><code>import pandas as pd
  df = pd.DataFrame([{'Person':'student 1', 'Course':['course 1']}, {'Person':'student 2','Course':['course 1', 'course 2']}, {'Person':'teacher 1','Course':['course 1', 'course 2']}])
  print(df)
  
  df.loc[df['c1'].str.contains('student'), 'main student course'] = #first element of the list in 'Course' column.
  </code></pre>
  <p>How can I do this?</p>