I have a function func
that takes two strings as input and returns an integer as an output. I have two different dataframes and I want to use the 'Name' column of both these dataframes as an input to the function.
Suppose,
In [12]: DF1
Out[12]:
Name
0 Apple
1 Banana
2 Orange
and
In [13]: DF2
Out[13]:
Name
0 Spider
1 Yak
2 Wolf
Now, I want use func
and provide inputs to it like
func('apple','spider')
func('apple','yak')
func('apple','wolf')
func('banana','spider')
...
I tried doing this by using itertools
but as the dataset is large it is taking a lot of time. So how could it be done using vectorized operations or what would be the most efficient way to do it?
edit: I am trying to do something like:
for i in DF1['Name']:
for j in DF2['Name']:
func(i,j)