Python Pandas DataFrame: Split variable text column and then count -


i have column in database each cell having list of e-mail addresses separated commas. each cell has different numbers of e-mail addresses. trying figure out e-mail address common overall.

i thinking combine these cells 1 cell, , split thm comma, , use counter function find used e-mail address. getting stuck @ first step. there way combine everything?

in[0] import pandas pd  in[1] data = pd.series(["abc@def.com,pqr@def.com", "abc@def.com", "abc@def.com,xyz@def.com,pqr@def.com"])  in[3]: data = pd.dataframe(data, columns=["emails"])  in[4]: pd.series(data.emails.str.split(',', expand=true).values.ravel()).mode().values[0] out[4]: 'abc@def.com' 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -