title: How to pass an entire column as a parameter to tldextract function?
body: <p>tldextract is used to extract domain names from the URLs. Here, 'url' is one of the column name in the data frame 'df'. It is possible to  pass one value of 'url' as a parameter. However, I am not able to pass the entire column as a parameter.
  The url being passed here is '<a href="https://www.google.com/search?source=hp&amp;ei=7iE" rel="nofollow noreferrer">https://www.google.com/search?source=hp&amp;ei=7iE</a>'</p>
  
  <pre><code>listed = tldextract.extract(df['url'][0])
  dom_name = listed.domain
  print(dom_name)
  </code></pre>
  
  <p>Output:
  google</p>
  
  <p>What I want is to create a new column in the data frame named 'Domain' having the extracted domain names from the URL.</p>
  
  <p>Something like:</p>
  
  <pre><code>df['Domain'] = tldextract.extract(df['url'])
  </code></pre>
  
  <p>But this isn't working</p>
  
  <p>Here is the code:</p>
  
  <pre><code># IMPORTING PANDAS
  import pandas as pd
  from IPython.display import display
  
  import tldextract
  
  # Read data sample
  df = pd.read_csv("bookcsv.csv")
  
  df['Domain'] = df['url'].apply(lambda url: tldextract.extract(url).domain)
  </code></pre>
  
  <p>Here is the input data:</p>
  
  <p><a href="https://i.stack.imgur.com/osHZs.png" rel="nofollow noreferrer">The dataframe looks like this</a>
  I am not able to put the data directly here. So, I am posting a snapshot.</p>