PEM-Humboldt / regi0

A Python package to complement and verify biological records
https://regi0.readthedocs.io
MIT License
2 stars 2 forks source link

Allow passing numpy 1D arrays in functions that take scientific names #57

Closed marcelovilla closed 2 years ago

marcelovilla commented 2 years ago

Currently, passing a NumPy 1D array with scientific names to certain functions will yield the following error:

AttributeError: 'numpy.ndarray' object has no attribute 'dropna'

Code to reproduce the error:

import regi0

names = pd.Series(["Tremarctos ornatus", "Panthera onca", "Tremarctos ornatus"])
unique_names = names.unique()
regi0.taxonomic.gnr.resolve(unique_names)

However, the following code will work correctly:

import regi0

names = pd.Series(["Tremarctos ornatus", "Panthera onca", "Tremarctos ornatus"])
unique_names = names.unique()
regi0.taxonomic.gnr.resolve(pd.Series(unique_names))