sckott / pytaxize

python port of taxize (taxonomy toolbelt) for R
https://sckott.github.io/pytaxize/
MIT License
34 stars 13 forks source link

Python3 pandas error #43

Closed ghost closed 7 years ago

ghost commented 7 years ago

I'm getting an error on Python 3.5 in the conversion to a pandas dataframe. It look like that is simple fix: http://stackoverflow.com/questions/25146487/python-3-4-error-when-creating-a-dataframe-with-panda
If it would be helpful I can submit a pull request with a fix.

import pytaxize pytaxize.searchbycommonname(x="american bullfrog")


TypeError Traceback (most recent call last)

in () 1 import pytaxize ----> 2 pytaxize.searchbycommonname(x="american bullfrog") C:\Anaconda3\envs\pymdwizard3\lib\site-packages\pytaxize\itis.py in searchbycommonname(x, *_kwargs) 762 matches = ["commonName","language","tsn"] 763 tmp = out.xpath('//ax21:commonNames', namespaces=ns21) --> 764 return _itisdf(tmp[0], ns21, matches, _tolower(matches)) 765 766 def searchbycommonnamebeginswith(x, *_kwargs): C:\Anaconda3\envs\pymdwizard3\lib\site-packages\pytaxize\itis.py in _itisdf(a, b, matches, colnames, pastens) 899 # spurious None 900 output[-1] = output[-1][1:] --> 901 df = pd.DataFrame( zip(*output), columns=colnames )[ colnames[::-1] ] 902 return df 903 C:\Anaconda3\envs\pymdwizard3\lib\site-packages\pandas\core\frame.py in **init**(self, data, index, columns, dtype, copy) 323 mgr = self._init_dict({}, index, columns, dtype=dtype) 324 elif isinstance(data, collections.Iterator): --> 325 raise TypeError("data argument can't be an iterator") 326 else: 327 try: TypeError: data argument can't be an iterator
sckott commented 7 years ago

thanks for the report, please do PR

sckott commented 7 years ago

fixed in #44