Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How can I append a list/vector in python as a comma separated string of two values as each of its elements?

$
0
0

@himanshu.doi wrote:

Suppose I have a vector a which contains emails of different users:
a =
('rahul.kumar@gmail.com','akashaggarwal123@gmail.com','ank.mishra@gmail.com','kumar.rahul96@gmail.com','rahulganotra@yahoo.com')

I tried writing a code to run a for loop on this vector to identify similar emails using the python fuzzywuzzy library and obtain the required output:

 email = []
     for i in range(0,len(a)):
           for j in range(i+1,len(a)):
                if(fuzz.token_sort_ratio(a[i],a[j]) >83):
                    email.append(a[i], a[j])

But this obviously doesn't work.
I want to append the similar emails in email[] as:

I know there must be some way for this, i just can't figure it out. If anyone could help me out with this?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles