Can't iterate over a Numpy array while FTS on SNOMEDCT

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't iterate over a Numpy array while FTS on SNOMEDCT

Orneyfish
This post was updated on .
I have tried to iterate over a NumPy array containing the string for search. I can't append the returns of the FUnction call SNOMEDCT_US.Search() while iterating. can Some one help?
Code:
import pandas as pd
df=pd.read_csv("/content/results_duplicate_refined.csv")
entities=df.iloc[:, 1:2].values
for row in entities:
  SNOMEDCT_US.search(row)
I want to print this or save the search result to a particular Numpy array or something like that. How can I do that?
Reply | Threaded
Open this post in threaded view
|

Re: Can't iterate over a Numpy array while FTS on SNOMEDCT

Jiba
Administrator
Hi,

Are you sure that you are getting Python string from the Pandas array ? And not NumPy datatypes ?

You may try : SNOMEDCT_US.search(str(row))

Or verify the type of row.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Can't iterate over a Numpy array while FTS on SNOMEDCT

Orneyfish
Yes I have done one hot encoding and done the search made it string and done the search. Nothing has given me result.