擅长:python、mysql、java
<p>函数应该返回一个序列:</p>
<pre><code>def geo(address):
location = geocode(address)
result = location.result
coords = location.coords
return pd.Series([coords, result], ['coordinates', 'gps_status'])
df['output'] = df['address'].apply(geo)
</code></pre>
<hr/>
<p>也就是说,这可能更好地写成<a href="http://pandas.pydata.org/pandas-docs/stable/merging.html#database-style-dataframe-joining-merging" rel="nofollow">merge</a>。在</p>