title: Attribute Error when getting unique column values
body: <p>I am new to Python and Pandas. I am trying to write a function to get a unique list of my column values. My function looks like below, where "placename" is the attribute that I want to get unique values. 'placename' should be passed as a string argument,corresponding to the header of the csv file.</p>
  
  <pre><code>def get_city_list(state, type, placename):
  
       city_dir = os.path.join(baseDir, type + ".csv")
       city_df = pd.read_csv(city_dir, quotechar = '"', skipinitialspace = True, sep = ",") 
  
       state_df = city_df.loc[city_df["state"] == state] 
  
       city_list = state_df.placename.unique()
  
       return city_list
  </code></pre>
  
  <p>However, when I call this function, it throws a attribute error saying 'DataFrame' object has no attribute "placename". It seems that "placename" should not be a string, and when I substitute it as<br>
  city_list = state_df.cityname.unique(), it works, where cityname (without " ") is the actual header of the column in the original csv file. Since I want to make my function versatile,I want to find a way to deal with this case so that I dont have to manually change the content of "placename" every time.</p>
  
  <p>Your help is greatly appreciated! </p>
  
  <p>Thanks  </p>