title: Passing spark dataframe columns to geohash function - pyspark. Cannot convert column into bool:
body: <pre><code>import pygeohash as pgh
  
  pgh.encode(45,55)
  
  'tpzpgxczbzur'
  </code></pre>
  
  <p>The above steps are working great. Below I'm trying to create a data frame:</p>
  
  <pre><code>l = [(45,25),(75,22),(85,20),(89,26)]
  
  rdd = sc.parallelize(l)
  geoCords = rdd.map(lambda x: Row(lat=x[0], long=int(x[1])))
  geoCordsSchema = sqlContext.createDataFrame(geoCords)
  geoCordsSchema.show()
  
  +---+----+
  |lat|long|
  +---+----+
  | 45|  25|
  | 75|  22|
  | 85|  20|
  | 89|  26|
  +---+----+
  </code></pre>
  
  <p>This successfully creates a spark dataframe. Now I'm using Pygeohash encode, and throwing error as below: </p>
  
  <pre><code>pgh.encode(geoCordsSchema.lat, geoCordsSchema.long, precision = 7)
  
  Traceback (most recent call last):
     File "&lt;stdin&gt;", line 1, in &lt;module&gt;
     File "/Library/Python/2.7/site-packages/pygeohash/geohash.py", line 96, in encode
     if longitude &gt; mid:
     File "/usr/local/spark/python/pyspark/sql/column.py", line 427, in __nonzero__
     raise ValueError("Cannot convert column into bool: please use '&amp;' for 'and', '|' for 'or', "
  ValueError: Cannot convert column into bool: please use '&amp;' for 'and', '|' for 'or', '~' for 'not' when building DataFrame boolean expressions.
  </code></pre>