import matplotlib.pyplot as plt
import pandas as pd #this is how I usually import pandas
data = pd.read_csv("loveisland_livestream_sunday.csv", encoding = 'utf-8', names = ["created", "text", "language",
"user", "hashtags", "mentions" , "description", "followers", "friends", "location", "verified", "latitude", "longitude"])
data
created | text | language | user | hashtags | mentions | description | followers | friends | location | verified | latitude | longitude | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 2017-07-02 20:05:46 | I really can't believe Camilla has fallen for ... | en | Curt_AFC | ['LoveIsland'] | [] | *BEWARE* 50.1% Banter, 49.9% Sarcasm - Follow ... | 2181 | 450 | R.I.P Change... | False | NaN | NaN |
1 | 2017-07-02 20:05:46 | Me when #loveisland starts π As I hear the Sup... | en | MissChloeMay | ['loveisland'] | [] | Wife To @sgriffo83 β€οΈ Mommy To Two Prinnies & ... | 234 | 869 | Warwickshireβ€οΈ | False | NaN | NaN |
2 | 2017-07-02 20:05:46 | I LOVE THIS FRIENDSHIP #loveisland | en | pottsy000 | ['loveisland'] | [] | Just a crazy lesbian fan girl... What more cou... | 1982 | 1879 | Gina π₯π | False | NaN | NaN |
3 | 2017-07-02 20:05:46 | Montana is so beaut π» #LoveIsland | en | HollyBoon__ | ['LoveIsland'] | [] | i like to create art on the face. ... | 47578 | 863 | NaN | False | NaN | NaN |
4 | 2017-07-02 20:05:46 | Craig has made Camilla lose composure. Nah pis... | en | K_Messias_ | ['loveisland'] | [] | My followers and I discuss a variety of topics... | 3484 | 939 | London | False | NaN | NaN |
5 | 2017-07-02 20:05:47 | Feelings in 24 hrs? #loveisland | en | maysmara | ['loveisland'] | [] | don't sleep on me. sc : maysmara | 852 | 551 | NaN | False | NaN | NaN |
6 | 2017-07-02 20:05:47 | Shit is gonna hit the fan in tonight's episode... | en | greglee91 | ['LoveIsland'] | [] | Avid gig goer. Music & film lover. Chelsea FC. | 2974 | 1052 | London | False | NaN | NaN |
7 | 2017-07-02 20:05:46 | Get to the meltdowns pls. #LoveIsland https://... | en | rebekkablogs | ['LoveIsland'] | [] | I tweet, I blog & I don't think before I speak... | 4198 | 1928 | Norwich | False | NaN | NaN |
8 | 2017-07-02 20:05:47 | Craig is coming on so strong back off #LoveIsland | en | Average_Jordd | ['LoveIsland'] | [] | probably Overthinking | 901 | 1294 | Uplowman, England | False | NaN | NaN |
9 | 2017-07-02 20:05:48 | Gutted for Gabby but can't wait to see Amber g... | en | __alextyler | ['loveisland'] | [] | NaN | 484 | 954 | NaN | False | NaN | NaN |
10 | 2017-07-02 20:05:48 | Can't wait for the episode that Camilla Wales ... | en | AlexMorley1 | ['LoveIsland'] | [] | NaN | 198 | 484 | Shrewsbury | False | NaN | NaN |
11 | 2017-07-02 20:05:48 | Camilla don't fall into the dick sand! #LoveIs... | en | EmilyLClifford | ['LoveIsland'] | [] | Gin, astronomy, Greek mythology 40/50's Pin Up... | 288 | 470 | Somewhere outside the M25 | False | NaN | NaN |
12 | 2017-07-02 20:05:48 | Camilla'a eyelashes are amazing π #LoveIsland | en | Bethan__Turner | ['LoveIsland'] | [] | 24. I once spelt my surname wrong on here for ... | 233 | 369 | Wales, United Kingdom | False | NaN | NaN |
13 | 2017-07-02 20:05:48 | My Turkish nan has sat down with us to watch #... | en | havvarebke | ['LoveIsland'] | [] | πΌSinger/Songwriter πΈ Instagram - havvarebke πL... | 14358 | 389 | NaN | True | NaN | NaN |
14 | 2017-07-02 20:05:49 | Imagine the world was full of people like Cami... | en | DPatz13 | ['LoveIsland'] | ['LoveIsland'] | He who dares, wins! | The angels in my life ar... | 3599 | 3497 | Dromore, Northern Ireland | False | NaN | NaN |
15 | 2017-07-02 20:05:48 | "Can I copy your homework"\n"Yeah just change ... | en | emcainxo | ['loveisland'] | [] | NaN | 386 | 483 | NaN | False | NaN | NaN |
16 | 2017-07-02 20:05:49 | Alex is peng. The wait was worth was it Montan... | en | sxde_ | ['LoveIsland'] | [] | NaN | 332 | 280 | Midlands | False | NaN | NaN |
17 | 2017-07-02 20:05:50 | i love that camilla's happy but there's someth... | en | deIesalli | ['loveisland'] | [] | is this real? @rossfbutlers | 3277 | 85 | keeley em | False | NaN | NaN |
18 | 2017-07-02 20:05:50 | Am I the only one who likes Craifπ« #LoveIsland | en | zainab_010 | ['LoveIsland'] | [] | NaN | 367 | 589 | NaN | False | NaN | NaN |
19 | 2017-07-02 20:05:50 | Camilla you're only more comfy with him becaus... | en | _abzx | ['LoveIsland'] | [] | fresher than yew. | 317 | 288 | NaN | False | NaN | NaN |
20 | 2017-07-02 20:05:50 | This Craig is an absolute Helmet man, stop thi... | en | Tleepont | ['loveisland'] | [] | If you a cutie pie, i eat cha #fim | 572 | 359 | Sprotbrough, England | False | NaN | NaN |
21 | 2017-07-02 20:05:50 | Camilla mannnnnnn if only you knew #loveisland | en | xpdalia_ | ['loveisland'] | [] | βΏ β π¦ | 498 | 331 | NaN | False | NaN | NaN |
22 | 2017-07-02 20:05:50 | Oh my god, Alex talking about Montana melts my... | en | rebecca_emx | ['loveisland'] | [] | I'd rather be on the π | 170 | 513 | NaN | False | NaN | NaN |
23 | 2017-07-02 20:05:50 | Everyone moaning about Jonny but look how cami... | en | celticgunner | ['loveisland'] | [] | Instagram- jconway_designs - Working class thr... | 341 | 203 | London, England | False | NaN | NaN |
24 | 2017-07-02 20:05:51 | Craig is genuinely nice just has a crazy ex gi... | en | zawenaeb | ['LoveIsland'] | [] | Sales Assistant, Personal Trainer and Sports M... | 129 | 314 | NaN | False | NaN | NaN |
25 | 2017-07-02 20:05:51 | Can't be the only one sick of the bastard sigh... | en | Chrismark94 | ['LoveIsland'] | [] | 23 The toon (Newcastle)π \nHorse racing , UFC/M... | 224 | 602 | NaN | False | NaN | NaN |
26 | 2017-07-02 20:05:51 | Montana and Camilla are friendship Goals!!ππ» #... | en | JoeeBrennan | ['LoveIsland'] | [] | Student | Labourππ» | School| Interested In Pol... | 877 | 890 | Central London | False | NaN | NaN |
27 | 2017-07-02 20:05:51 | Too excited to see this drama π€£π€£π€£ #loveisland ... | en | MissLauraAlicia | ['loveisland'] | ['LoveIsland'] | Diamonds aren't a girls BestFriend- Yorkies ar... | 86424 | 1770 | Manchester, England | True | NaN | NaN |
28 | 2017-07-02 20:05:51 | "Never known her to be so happy" love you have... | en | carlroybird | ['LoveIsland'] | [] | #coys | 497 | 250 | Bognor Regis, England | False | NaN | NaN |
29 | 2017-07-02 20:05:52 | alex and mon are so cute #LoveIsland https://... | en | buteradrums | ['LoveIsland'] | [] | what if it doesn't come true? ah, but what if ... | 5900 | 987 | Manchester, England | False | NaN | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
22243 | 2017-07-02 20:49:40 | Chris coming back into the Villa #LoveIsland h... | en | Jason_vickers96 | ['LoveIsland'] | [] | LJMU π β½οΈ\nFormer Liverpool FC International A... | 1130 | 434 | Preston, England | False | NaN | NaN |
22244 | 2017-07-02 20:49:40 | #LoveIsland this year is just the best thing. ... | en | LRGomess | ['LoveIsland'] | [] | β SMILES. Music. Traveling. Food. #Optimism #I... | 109 | 197 | London | False | NaN | NaN |
22245 | 2017-07-02 20:49:40 | Absolutely knackered but gotta stay up to watc... | en | immsss_17 | ['LoveIsland'] | [] | NaN | 386 | 198 | NaN | False | NaN | NaN |
22246 | 2017-07-02 20:49:40 | If cam decides to stick I'm going to flip #lov... | en | gamecubemike | ['loveisland'] | [] | A fun person working #CFC fan hit by #Colitis... | 683 | 2816 | Essex | False | NaN | NaN |
22247 | 2017-07-02 20:49:41 | Amber is so fucking fit though #LoveIsland | en | YohGaming | ['LoveIsland'] | [] | P. β€ | 48 | 144 | Stainforth, England | False | NaN | NaN |
22248 | 2017-07-02 20:49:41 | I genuinely don't want Amber to go, I know eve... | en | assuminglily | ['loveisland'] | [] | he deserved the universe, but you were just a ... | 326 | 594 | Lizzie β’ Zoe β’ Sam | False | NaN | NaN |
22249 | 2017-07-02 20:49:41 | Camilla has to choose Craig #loveisland | en | silverjade35 | ['loveisland'] | [] | π€ Love Life π My Crazy World π Wineslut π Uniq... | 468 | 882 | NaN | False | NaN | NaN |
22250 | 2017-07-02 20:49:41 | ππ Something tells me the #sisterhood ain't ra... | en | SchwartzSaxon | ['sisterhood', 'LoveIsland'] | [] | Life is understood backwards but must be lived... | 179 | 221 | LDN | False | NaN | NaN |
22251 | 2017-07-02 20:49:41 | @sdeptford7 The fact Camilla even contemplated... | en | TommoKelly | ['Jonnythefuckboy', 'LoveIsland'] | ['sdeptford7'] | Digital Marketer at Laser Red. Hit me up if yo... | 206 | 542 | England | False | NaN | NaN |
22252 | 2017-07-02 20:49:41 | Camilla, don't even thinking about choosing Jo... | en | BethansCrib | ['loveisland'] | [] | Don't let the muggles get you down. | 701 | 1759 | Wiltshire | False | NaN | NaN |
22253 | 2017-07-02 20:49:42 | LITERALLY ON THE EDGE OF MY SEAT π #LoveIsland... | en | Dannibear21 | ['LoveIsland', 'BestTwistEver'] | [] | She's got it out for me but I wear the biggest... | 176 | 275 | NaN | False | NaN | NaN |
22254 | 2017-07-02 20:49:42 | I cannot deal with how intense this is i think... | en | leah1992 | ['LoveIsland'] | [] | NaN | 72 | 265 | NaN | False | NaN | NaN |
22255 | 2017-07-02 20:49:42 | I feel like Dom's going home tonight #LoveIsland | en | Crazydivaaaa | ['LoveIsland'] | [] | New Account⨠| 93 | 54 | Bristol, England | False | NaN | NaN |
22256 | 2017-07-02 20:49:42 | Anyone that tells you Love Island isn't the gr... | en | Garratt1993 | ['LoveIsland'] | [] | Sergio Busquets, Thomas MΓΌller, Harambe & United. | 540 | 468 | Manchester | False | NaN | NaN |
22257 | 2017-07-02 20:49:42 | I look like this https://t.co/vjo2inmglr | en | chxrIes | [] | [] | I need a room full of mirrors so I can be surr... | 949 | 159 | NaN | False | NaN | NaN |
22258 | 2017-07-02 20:49:42 | Adverts taking tho piss tonight βοΈ come on! #l... | en | jaymielou92 | ['loveisland'] | [] | NaN | 115 | 383 | plymouth | False | NaN | NaN |
22259 | 2017-07-02 20:49:42 | Really hoping Amber has chosen to recouple @Am... | en | leviphillipss | ['LoveIsland'] | ['Amber_Davies7'] | NaN | 138 | 204 | Wales, United Kingdom | False | NaN | NaN |
22260 | 2017-07-02 20:49:42 | i love domπ #loveisland | en | hollysalisburyx | ['loveisland'] | [] | nobody really likes us except for us | 600 | 393 | uk | False | NaN | NaN |
22261 | 2017-07-02 20:49:42 | Can't cope but I hope he picks her tho πππππ h... | en | tashahoughx | [] | [] | sleep tight Grandad, missed & loved so much 28... | 576 | 574 | NaN | False | NaN | NaN |
22262 | 2017-07-02 20:49:43 | Tyla, you can't sit with them. π https://t.co/... | en | Gabriella__Ox | [] | [] | To live would be an awfully big adventure. | 232 | 437 | NaN | False | NaN | NaN |
22263 | 2017-07-02 20:49:43 | @gabbydawnallen and @marcel_rockyb make me cry... | en | DennettJenna | ['LoveIsland'] | ['gabbydawnallen', 'marcel_rockyb'] | NaN | 72 | 1952 | Keighley, England | False | NaN | NaN |
22264 | 2017-07-02 20:49:43 | Gutted I aint watching #loveisland | en | declew | ['loveisland'] | [] | NaN | 167 | 449 | Newport City | False | NaN | NaN |
22265 | 2017-07-02 20:49:43 | Same thing we did last year. Cry https://t.co/... | en | CoCoMaiPhillips | [] | [] | π A Real Ting π« | 1463 | 738 | MaiMai's Nirvana | False | NaN | NaN |
22266 | 2017-07-02 20:49:44 | can dom plz get sent home to jess bc if he rec... | en | naomilumsdenn | ['loveisland'] | [] | bitter bitch // ig; naomilumsdenn | 593 | 267 | United Kingdom | False | NaN | NaN |
22267 | 2017-07-02 20:49:44 | My heart breaks for Gabby, game or not, marcel... | en | Pops8Read | ['LoveIsland'] | [] | 17 | 749 | 689 | NaN | False | NaN | NaN |
22268 | 2017-07-02 20:49:44 | Did anyone else see Dom shaving under his eye ... | en | KerrieLPollock | ['loveisland'] | [] | NaN | 261 | 957 | NaN | False | NaN | NaN |
22269 | 2017-07-02 20:49:44 | That is the THE most intense thing I've watche... | en | Faz__1 | ['LoveIsland'] | [] | ππ±Instagram: faz__ali | 241 | 94 | Edinburgh, Scotland | False | NaN | NaN |
22270 | 2017-07-02 20:49:44 | Fm #LoveIsland is so intense π π π π π π π π π | en | Chloe77streak | ['LoveIsland'] | [] | πΈπΌ | Sixteen | Berkshire | 589 | 2110 | British Gurlπ¬π§πΈπΌ | False | NaN | NaN |
22271 | 2017-07-02 20:49:44 | Looks like Kem is gonna give Amber the red lig... | en | DarrenWalshPuns | ['LoveIsland'] | [] | Stand-up: http://youtu.be/KjuyaLd7xmI. Agent: ... | 4627 | 1734 | London | True | NaN | NaN |
22272 | 2017-07-02 20:49:44 | Kem bouncing in with chyna ππ #loveisland | en | darrenwatson7 | ['loveisland'] | [] | FOREVER A BMX BANDIT........... | 401 | 717 | Townhill | False | NaN | NaN |
22273 rows Γ 13 columns
data['text'] = data['text'].str.lower()
data
created | text | language | user | hashtags | mentions | description | followers | friends | location | verified | latitude | longitude | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 2017-07-02 20:05:46 | i really can't believe camilla has fallen for ... | en | Curt_AFC | ['LoveIsland'] | [] | *BEWARE* 50.1% Banter, 49.9% Sarcasm - Follow ... | 2181 | 450 | R.I.P Change... | False | NaN | NaN |
1 | 2017-07-02 20:05:46 | me when #loveisland starts π as i hear the sup... | en | MissChloeMay | ['loveisland'] | [] | Wife To @sgriffo83 β€οΈ Mommy To Two Prinnies & ... | 234 | 869 | Warwickshireβ€οΈ | False | NaN | NaN |
2 | 2017-07-02 20:05:46 | i love this friendship #loveisland | en | pottsy000 | ['loveisland'] | [] | Just a crazy lesbian fan girl... What more cou... | 1982 | 1879 | Gina π₯π | False | NaN | NaN |
3 | 2017-07-02 20:05:46 | montana is so beaut π» #loveisland | en | HollyBoon__ | ['LoveIsland'] | [] | i like to create art on the face. ... | 47578 | 863 | NaN | False | NaN | NaN |
4 | 2017-07-02 20:05:46 | craig has made camilla lose composure. nah pis... | en | K_Messias_ | ['loveisland'] | [] | My followers and I discuss a variety of topics... | 3484 | 939 | London | False | NaN | NaN |
5 | 2017-07-02 20:05:47 | feelings in 24 hrs? #loveisland | en | maysmara | ['loveisland'] | [] | don't sleep on me. sc : maysmara | 852 | 551 | NaN | False | NaN | NaN |
6 | 2017-07-02 20:05:47 | shit is gonna hit the fan in tonight's episode... | en | greglee91 | ['LoveIsland'] | [] | Avid gig goer. Music & film lover. Chelsea FC. | 2974 | 1052 | London | False | NaN | NaN |
7 | 2017-07-02 20:05:46 | get to the meltdowns pls. #loveisland https://... | en | rebekkablogs | ['LoveIsland'] | [] | I tweet, I blog & I don't think before I speak... | 4198 | 1928 | Norwich | False | NaN | NaN |
8 | 2017-07-02 20:05:47 | craig is coming on so strong back off #loveisland | en | Average_Jordd | ['LoveIsland'] | [] | probably Overthinking | 901 | 1294 | Uplowman, England | False | NaN | NaN |
9 | 2017-07-02 20:05:48 | gutted for gabby but can't wait to see amber g... | en | __alextyler | ['loveisland'] | [] | NaN | 484 | 954 | NaN | False | NaN | NaN |
10 | 2017-07-02 20:05:48 | can't wait for the episode that camilla wales ... | en | AlexMorley1 | ['LoveIsland'] | [] | NaN | 198 | 484 | Shrewsbury | False | NaN | NaN |
11 | 2017-07-02 20:05:48 | camilla don't fall into the dick sand! #loveis... | en | EmilyLClifford | ['LoveIsland'] | [] | Gin, astronomy, Greek mythology 40/50's Pin Up... | 288 | 470 | Somewhere outside the M25 | False | NaN | NaN |
12 | 2017-07-02 20:05:48 | camilla'a eyelashes are amazing π #loveisland | en | Bethan__Turner | ['LoveIsland'] | [] | 24. I once spelt my surname wrong on here for ... | 233 | 369 | Wales, United Kingdom | False | NaN | NaN |
13 | 2017-07-02 20:05:48 | my turkish nan has sat down with us to watch #... | en | havvarebke | ['LoveIsland'] | [] | πΌSinger/Songwriter πΈ Instagram - havvarebke πL... | 14358 | 389 | NaN | True | NaN | NaN |
14 | 2017-07-02 20:05:49 | imagine the world was full of people like cami... | en | DPatz13 | ['LoveIsland'] | ['LoveIsland'] | He who dares, wins! | The angels in my life ar... | 3599 | 3497 | Dromore, Northern Ireland | False | NaN | NaN |
15 | 2017-07-02 20:05:48 | "can i copy your homework"\n"yeah just change ... | en | emcainxo | ['loveisland'] | [] | NaN | 386 | 483 | NaN | False | NaN | NaN |
16 | 2017-07-02 20:05:49 | alex is peng. the wait was worth was it montan... | en | sxde_ | ['LoveIsland'] | [] | NaN | 332 | 280 | Midlands | False | NaN | NaN |
17 | 2017-07-02 20:05:50 | i love that camilla's happy but there's someth... | en | deIesalli | ['loveisland'] | [] | is this real? @rossfbutlers | 3277 | 85 | keeley em | False | NaN | NaN |
18 | 2017-07-02 20:05:50 | am i the only one who likes craifπ« #loveisland | en | zainab_010 | ['LoveIsland'] | [] | NaN | 367 | 589 | NaN | False | NaN | NaN |
19 | 2017-07-02 20:05:50 | camilla you're only more comfy with him becaus... | en | _abzx | ['LoveIsland'] | [] | fresher than yew. | 317 | 288 | NaN | False | NaN | NaN |
20 | 2017-07-02 20:05:50 | this craig is an absolute helmet man, stop thi... | en | Tleepont | ['loveisland'] | [] | If you a cutie pie, i eat cha #fim | 572 | 359 | Sprotbrough, England | False | NaN | NaN |
21 | 2017-07-02 20:05:50 | camilla mannnnnnn if only you knew #loveisland | en | xpdalia_ | ['loveisland'] | [] | βΏ β π¦ | 498 | 331 | NaN | False | NaN | NaN |
22 | 2017-07-02 20:05:50 | oh my god, alex talking about montana melts my... | en | rebecca_emx | ['loveisland'] | [] | I'd rather be on the π | 170 | 513 | NaN | False | NaN | NaN |
23 | 2017-07-02 20:05:50 | everyone moaning about jonny but look how cami... | en | celticgunner | ['loveisland'] | [] | Instagram- jconway_designs - Working class thr... | 341 | 203 | London, England | False | NaN | NaN |
24 | 2017-07-02 20:05:51 | craig is genuinely nice just has a crazy ex gi... | en | zawenaeb | ['LoveIsland'] | [] | Sales Assistant, Personal Trainer and Sports M... | 129 | 314 | NaN | False | NaN | NaN |
25 | 2017-07-02 20:05:51 | can't be the only one sick of the bastard sigh... | en | Chrismark94 | ['LoveIsland'] | [] | 23 The toon (Newcastle)π \nHorse racing , UFC/M... | 224 | 602 | NaN | False | NaN | NaN |
26 | 2017-07-02 20:05:51 | montana and camilla are friendship goals!!ππ» #... | en | JoeeBrennan | ['LoveIsland'] | [] | Student | Labourππ» | School| Interested In Pol... | 877 | 890 | Central London | False | NaN | NaN |
27 | 2017-07-02 20:05:51 | too excited to see this drama π€£π€£π€£ #loveisland ... | en | MissLauraAlicia | ['loveisland'] | ['LoveIsland'] | Diamonds aren't a girls BestFriend- Yorkies ar... | 86424 | 1770 | Manchester, England | True | NaN | NaN |
28 | 2017-07-02 20:05:51 | "never known her to be so happy" love you have... | en | carlroybird | ['LoveIsland'] | [] | #coys | 497 | 250 | Bognor Regis, England | False | NaN | NaN |
29 | 2017-07-02 20:05:52 | alex and mon are so cute #loveisland https://... | en | buteradrums | ['LoveIsland'] | [] | what if it doesn't come true? ah, but what if ... | 5900 | 987 | Manchester, England | False | NaN | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
22243 | 2017-07-02 20:49:40 | chris coming back into the villa #loveisland h... | en | Jason_vickers96 | ['LoveIsland'] | [] | LJMU π β½οΈ\nFormer Liverpool FC International A... | 1130 | 434 | Preston, England | False | NaN | NaN |
22244 | 2017-07-02 20:49:40 | #loveisland this year is just the best thing. ... | en | LRGomess | ['LoveIsland'] | [] | β SMILES. Music. Traveling. Food. #Optimism #I... | 109 | 197 | London | False | NaN | NaN |
22245 | 2017-07-02 20:49:40 | absolutely knackered but gotta stay up to watc... | en | immsss_17 | ['LoveIsland'] | [] | NaN | 386 | 198 | NaN | False | NaN | NaN |
22246 | 2017-07-02 20:49:40 | if cam decides to stick i'm going to flip #lov... | en | gamecubemike | ['loveisland'] | [] | A fun person working #CFC fan hit by #Colitis... | 683 | 2816 | Essex | False | NaN | NaN |
22247 | 2017-07-02 20:49:41 | amber is so fucking fit though #loveisland | en | YohGaming | ['LoveIsland'] | [] | P. β€ | 48 | 144 | Stainforth, England | False | NaN | NaN |
22248 | 2017-07-02 20:49:41 | i genuinely don't want amber to go, i know eve... | en | assuminglily | ['loveisland'] | [] | he deserved the universe, but you were just a ... | 326 | 594 | Lizzie β’ Zoe β’ Sam | False | NaN | NaN |
22249 | 2017-07-02 20:49:41 | camilla has to choose craig #loveisland | en | silverjade35 | ['loveisland'] | [] | π€ Love Life π My Crazy World π Wineslut π Uniq... | 468 | 882 | NaN | False | NaN | NaN |
22250 | 2017-07-02 20:49:41 | ππ something tells me the #sisterhood ain't ra... | en | SchwartzSaxon | ['sisterhood', 'LoveIsland'] | [] | Life is understood backwards but must be lived... | 179 | 221 | LDN | False | NaN | NaN |
22251 | 2017-07-02 20:49:41 | @sdeptford7 the fact camilla even contemplated... | en | TommoKelly | ['Jonnythefuckboy', 'LoveIsland'] | ['sdeptford7'] | Digital Marketer at Laser Red. Hit me up if yo... | 206 | 542 | England | False | NaN | NaN |
22252 | 2017-07-02 20:49:41 | camilla, don't even thinking about choosing jo... | en | BethansCrib | ['loveisland'] | [] | Don't let the muggles get you down. | 701 | 1759 | Wiltshire | False | NaN | NaN |
22253 | 2017-07-02 20:49:42 | literally on the edge of my seat π #loveisland... | en | Dannibear21 | ['LoveIsland', 'BestTwistEver'] | [] | She's got it out for me but I wear the biggest... | 176 | 275 | NaN | False | NaN | NaN |
22254 | 2017-07-02 20:49:42 | i cannot deal with how intense this is i think... | en | leah1992 | ['LoveIsland'] | [] | NaN | 72 | 265 | NaN | False | NaN | NaN |
22255 | 2017-07-02 20:49:42 | i feel like dom's going home tonight #loveisland | en | Crazydivaaaa | ['LoveIsland'] | [] | New Account⨠| 93 | 54 | Bristol, England | False | NaN | NaN |
22256 | 2017-07-02 20:49:42 | anyone that tells you love island isn't the gr... | en | Garratt1993 | ['LoveIsland'] | [] | Sergio Busquets, Thomas MΓΌller, Harambe & United. | 540 | 468 | Manchester | False | NaN | NaN |
22257 | 2017-07-02 20:49:42 | i look like this https://t.co/vjo2inmglr | en | chxrIes | [] | [] | I need a room full of mirrors so I can be surr... | 949 | 159 | NaN | False | NaN | NaN |
22258 | 2017-07-02 20:49:42 | adverts taking tho piss tonight βοΈ come on! #l... | en | jaymielou92 | ['loveisland'] | [] | NaN | 115 | 383 | plymouth | False | NaN | NaN |
22259 | 2017-07-02 20:49:42 | really hoping amber has chosen to recouple @am... | en | leviphillipss | ['LoveIsland'] | ['Amber_Davies7'] | NaN | 138 | 204 | Wales, United Kingdom | False | NaN | NaN |
22260 | 2017-07-02 20:49:42 | i love domπ #loveisland | en | hollysalisburyx | ['loveisland'] | [] | nobody really likes us except for us | 600 | 393 | uk | False | NaN | NaN |
22261 | 2017-07-02 20:49:42 | can't cope but i hope he picks her tho πππππ h... | en | tashahoughx | [] | [] | sleep tight Grandad, missed & loved so much 28... | 576 | 574 | NaN | False | NaN | NaN |
22262 | 2017-07-02 20:49:43 | tyla, you can't sit with them. π https://t.co/... | en | Gabriella__Ox | [] | [] | To live would be an awfully big adventure. | 232 | 437 | NaN | False | NaN | NaN |
22263 | 2017-07-02 20:49:43 | @gabbydawnallen and @marcel_rockyb make me cry... | en | DennettJenna | ['LoveIsland'] | ['gabbydawnallen', 'marcel_rockyb'] | NaN | 72 | 1952 | Keighley, England | False | NaN | NaN |
22264 | 2017-07-02 20:49:43 | gutted i aint watching #loveisland | en | declew | ['loveisland'] | [] | NaN | 167 | 449 | Newport City | False | NaN | NaN |
22265 | 2017-07-02 20:49:43 | same thing we did last year. cry https://t.co/... | en | CoCoMaiPhillips | [] | [] | π A Real Ting π« | 1463 | 738 | MaiMai's Nirvana | False | NaN | NaN |
22266 | 2017-07-02 20:49:44 | can dom plz get sent home to jess bc if he rec... | en | naomilumsdenn | ['loveisland'] | [] | bitter bitch // ig; naomilumsdenn | 593 | 267 | United Kingdom | False | NaN | NaN |
22267 | 2017-07-02 20:49:44 | my heart breaks for gabby, game or not, marcel... | en | Pops8Read | ['LoveIsland'] | [] | 17 | 749 | 689 | NaN | False | NaN | NaN |
22268 | 2017-07-02 20:49:44 | did anyone else see dom shaving under his eye ... | en | KerrieLPollock | ['loveisland'] | [] | NaN | 261 | 957 | NaN | False | NaN | NaN |
22269 | 2017-07-02 20:49:44 | that is the the most intense thing i've watche... | en | Faz__1 | ['LoveIsland'] | [] | ππ±Instagram: faz__ali | 241 | 94 | Edinburgh, Scotland | False | NaN | NaN |
22270 | 2017-07-02 20:49:44 | fm #loveisland is so intense π π π π π π π π π | en | Chloe77streak | ['LoveIsland'] | [] | πΈπΌ | Sixteen | Berkshire | 589 | 2110 | British Gurlπ¬π§πΈπΌ | False | NaN | NaN |
22271 | 2017-07-02 20:49:44 | looks like kem is gonna give amber the red lig... | en | DarrenWalshPuns | ['LoveIsland'] | [] | Stand-up: http://youtu.be/KjuyaLd7xmI. Agent: ... | 4627 | 1734 | London | True | NaN | NaN |
22272 | 2017-07-02 20:49:44 | kem bouncing in with chyna ππ #loveisland | en | darrenwatson7 | ['loveisland'] | [] | FOREVER A BMX BANDIT........... | 401 | 717 | Townhill | False | NaN | NaN |
22273 rows Γ 13 columns
len(data)
22273
def create_column (df, listname, search, contestant):
for index, row in df.iterrows():
if (search) in row.text:
listname.append(contestant)
else:
listname.append('')
se = pd.Series(listname)
df[contestant] = se.values
df
craig = []
create_column(data, craig, "craig", "Craig")
montana = []
create_column(data, montana, "montana", "Montana")
alex = []
create_column(data, alex, "alex", "Alex")
camilla = []
create_column(data, camilla, "camilla", "Camilla")
marcel = []
create_column(data, marcel, "marcel", "Marcel")
dom = []
create_column(data, dom, "dom", "Dom")
shannen = []
create_column(data, shannen, "shannen", "Shannen")
kem = []
create_column(data, kem, "kem", "Kem")
chyna = []
create_column(data, chyna, "chyna", "Chyna")
ellishajade = []
create_column(data, ellishajade, "ellisha", "Ellisha-Jade")
olivia = []
create_column(data, olivia, "liv", "Olivia")
amelia = []
create_column(data, amelia, "amelia", "Amelia")
danielle = []
create_column(data, danielle, "danielle", "Danielle")
amber = []
create_column(data, amber, "amber", "Amber")
rob = []
create_column(data, rob, "rob", "Rob")
nathan = []
create_column(data, nathan, "nathan", "Nathan")
steve = []
create_column(data, steve, "steve", "Steve")
marino = []
create_column(data, marino, "marino", "Marino")
chris = []
create_column(data, chris, "chris", "Chris")
jonny = []
create_column(data, jonny, "jonny", "Jonny")
gabby = []
create_column(data, gabby, "gab", "Gabby")
tyla = []
create_column(data, tyla, "tyla", "Tyla")
csv3 = data[['Craig', 'Montana', 'Alex',"Camilla","Marcel", "Dom", "Shannen","Kem", "Chyna", "Ellisha-Jade",
"Olivia", "Amelia", "Danielle", "Amber", "Rob", "Nathan", "Steve","Marino", "Chris",
"Jonny", "Gabby","Tyla", 'text']].copy()
csv3
Craig | Montana | Alex | Camilla | Marcel | Dom | Shannen | Kem | Chyna | Ellisha-Jade | ... | Amber | Rob | Nathan | Steve | Marino | Chris | Jonny | Gabby | Tyla | text | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Craig | Camilla | ... | i really can't believe camilla has fallen for ... | |||||||||||||||||
1 | ... | me when #loveisland starts π as i hear the sup... | |||||||||||||||||||
2 | ... | i love this friendship #loveisland | |||||||||||||||||||
3 | Montana | ... | montana is so beaut π» #loveisland | ||||||||||||||||||
4 | Craig | Camilla | ... | craig has made camilla lose composure. nah pis... | |||||||||||||||||
5 | ... | feelings in 24 hrs? #loveisland | |||||||||||||||||||
6 | ... | shit is gonna hit the fan in tonight's episode... | |||||||||||||||||||
7 | ... | get to the meltdowns pls. #loveisland https://... | |||||||||||||||||||
8 | Craig | ... | craig is coming on so strong back off #loveisland | ||||||||||||||||||
9 | ... | Amber | Gabby | gutted for gabby but can't wait to see amber g... | |||||||||||||||||
10 | Craig | Camilla | ... | can't wait for the episode that camilla wales ... | |||||||||||||||||
11 | Camilla | ... | camilla don't fall into the dick sand! #loveis... | ||||||||||||||||||
12 | Camilla | ... | camilla'a eyelashes are amazing π #loveisland | ||||||||||||||||||
13 | ... | my turkish nan has sat down with us to watch #... | |||||||||||||||||||
14 | Camilla | ... | imagine the world was full of people like cami... | ||||||||||||||||||
15 | ... | "can i copy your homework"\n"yeah just change ... | |||||||||||||||||||
16 | Montana | Alex | ... | alex is peng. the wait was worth was it montan... | |||||||||||||||||
17 | Craig | Camilla | ... | i love that camilla's happy but there's someth... | |||||||||||||||||
18 | ... | am i the only one who likes craifπ« #loveisland | |||||||||||||||||||
19 | Camilla | ... | camilla you're only more comfy with him becaus... | ||||||||||||||||||
20 | Craig | ... | this craig is an absolute helmet man, stop thi... | ||||||||||||||||||
21 | Camilla | ... | camilla mannnnnnn if only you knew #loveisland | ||||||||||||||||||
22 | Montana | Alex | ... | oh my god, alex talking about montana melts my... | |||||||||||||||||
23 | Camilla | ... | Jonny | everyone moaning about jonny but look how cami... | |||||||||||||||||
24 | Craig | ... | craig is genuinely nice just has a crazy ex gi... | ||||||||||||||||||
25 | Camilla | ... | can't be the only one sick of the bastard sigh... | ||||||||||||||||||
26 | Montana | Camilla | ... | montana and camilla are friendship goals!!ππ» #... | |||||||||||||||||
27 | ... | too excited to see this drama π€£π€£π€£ #loveisland ... | |||||||||||||||||||
28 | ... | "never known her to be so happy" love you have... | |||||||||||||||||||
29 | Alex | ... | alex and mon are so cute #loveisland https://... | ||||||||||||||||||
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
22243 | ... | Chris | chris coming back into the villa #loveisland h... | ||||||||||||||||||
22244 | Montana | ... | #loveisland this year is just the best thing. ... | ||||||||||||||||||
22245 | ... | absolutely knackered but gotta stay up to watc... | |||||||||||||||||||
22246 | ... | if cam decides to stick i'm going to flip #lov... | |||||||||||||||||||
22247 | ... | Amber | amber is so fucking fit though #loveisland | ||||||||||||||||||
22248 | ... | Amber | i genuinely don't want amber to go, i know eve... | ||||||||||||||||||
22249 | Craig | Camilla | ... | camilla has to choose craig #loveisland | |||||||||||||||||
22250 | ... | Amber | ππ something tells me the #sisterhood ain't ra... | ||||||||||||||||||
22251 | Camilla | ... | Jonny | @sdeptford7 the fact camilla even contemplated... | |||||||||||||||||
22252 | Camilla | ... | Jonny | camilla, don't even thinking about choosing jo... | |||||||||||||||||
22253 | ... | Steve | literally on the edge of my seat π #loveisland... | ||||||||||||||||||
22254 | ... | i cannot deal with how intense this is i think... | |||||||||||||||||||
22255 | Dom | ... | i feel like dom's going home tonight #loveisland | ||||||||||||||||||
22256 | ... | anyone that tells you love island isn't the gr... | |||||||||||||||||||
22257 | ... | i look like this https://t.co/vjo2inmglr | |||||||||||||||||||
22258 | ... | adverts taking tho piss tonight βοΈ come on! #l... | |||||||||||||||||||
22259 | ... | Amber | really hoping amber has chosen to recouple @am... | ||||||||||||||||||
22260 | Dom | ... | i love domπ #loveisland | ||||||||||||||||||
22261 | ... | can't cope but i hope he picks her tho πππππ h... | |||||||||||||||||||
22262 | ... | Tyla | tyla, you can't sit with them. π https://t.co/... | ||||||||||||||||||
22263 | Marcel | ... | Gabby | @gabbydawnallen and @marcel_rockyb make me cry... | |||||||||||||||||
22264 | ... | gutted i aint watching #loveisland | |||||||||||||||||||
22265 | ... | same thing we did last year. cry https://t.co/... | |||||||||||||||||||
22266 | Dom | ... | can dom plz get sent home to jess bc if he rec... | ||||||||||||||||||
22267 | Marcel | ... | Gabby | my heart breaks for gabby, game or not, marcel... | |||||||||||||||||
22268 | Dom | ... | did anyone else see dom shaving under his eye ... | ||||||||||||||||||
22269 | ... | that is the the most intense thing i've watche... | |||||||||||||||||||
22270 | ... | fm #loveisland is so intense π π π π π π π π π | |||||||||||||||||||
22271 | Kem | ... | Amber | looks like kem is gonna give amber the red lig... | |||||||||||||||||
22272 | Kem | Chyna | ... | kem bouncing in with chyna ππ #loveisland |
22273 rows Γ 23 columns
%matplotlib inline
from networkx.algorithms import bipartite
import matplotlib.pyplot as plt
%pylab inline
Populating the interactive namespace from numpy and matplotlib
import numpy as np
csv3 = csv3.apply(lambda x: x.str.strip()).replace('', np.nan)
csv4 = csv3.dropna(thresh=2)
#csv4 = csv4.fillna('')
unav = csv4.isnull().sum(axis=1).tolist()
se = pd.Series(unav)
csv4['missing'] = se.values
csv5 = csv4[csv4.missing == 20 ]
csv5 = csv5.fillna('')
csv5
/Applications/anaconda/lib/python3.5/site-packages/ipykernel/__main__.py:7: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
Craig | Montana | Alex | Camilla | Marcel | Dom | Shannen | Kem | Chyna | Ellisha-Jade | ... | Rob | Nathan | Steve | Marino | Chris | Jonny | Gabby | Tyla | text | missing | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Craig | Camilla | ... | i really can't believe camilla has fallen for ... | 20 | ||||||||||||||||
4 | Craig | Camilla | ... | craig has made camilla lose composure. nah pis... | 20 | ||||||||||||||||
9 | ... | Gabby | gutted for gabby but can't wait to see amber g... | 20 | |||||||||||||||||
10 | Craig | Camilla | ... | can't wait for the episode that camilla wales ... | 20 | ||||||||||||||||
16 | Montana | Alex | ... | alex is peng. the wait was worth was it montan... | 20 | ||||||||||||||||
17 | Craig | Camilla | ... | i love that camilla's happy but there's someth... | 20 | ||||||||||||||||
22 | Montana | Alex | ... | oh my god, alex talking about montana melts my... | 20 | ||||||||||||||||
23 | Camilla | ... | Jonny | everyone moaning about jonny but look how cami... | 20 | ||||||||||||||||
26 | Montana | Camilla | ... | montana and camilla are friendship goals!!ππ» #... | 20 | ||||||||||||||||
30 | Craig | ... | Jonny | ngl. but i think cam is forcing this way too m... | 20 | ||||||||||||||||
34 | Montana | Camilla | ... | i love the friendship between camilla and mont... | 20 | ||||||||||||||||
35 | Craig | Camilla | ... | #craig is playing the game! he knows how to ge... | 20 | ||||||||||||||||
38 | Craig | Camilla | ... | i swear to the gods, if craig is playing camil... | 20 | ||||||||||||||||
49 | Montana | Alex | ... | alex and montana are the cutestππ #loveisland | 20 | ||||||||||||||||
54 | Craig | Camilla | ... | but camilla, craig is just another 3 with sung... | 20 | ||||||||||||||||
61 | Craig | Camilla | ... | i just feel like somehow we need to send word ... | 20 | ||||||||||||||||
64 | Craig | Camilla | ... | still don't trust craig, think he's gone for c... | 20 | ||||||||||||||||
71 | Montana | ... | Jonny | so with tonight's twist i'm expecting montana ... | 20 | ||||||||||||||||
86 | Montana | Alex | ... | "she's the whole package." i'm so glad alex se... | 20 | ||||||||||||||||
90 | Craig | Camilla | ... | don't trust craig one bit. i feel like a prote... | 20 | ||||||||||||||||
92 | Craig | Camilla | ... | just wait until you find out what craig's done... | 20 | ||||||||||||||||
98 | Montana | Camilla | ... | can camilla and montanna get together pls, the... | 20 | ||||||||||||||||
103 | Craig | Camilla | ... | do you think craig has told camilla he has kid... | 20 | ||||||||||||||||
108 | Craig | Camilla | ... | no camilla don't fall for it! π±π±π± #cringeycrai... | 20 | ||||||||||||||||
109 | Kem | Chyna | ... | kem and chyna is the worst idea to ever exist ... | 20 | ||||||||||||||||
117 | Craig | Alex | ... | pretty sure there's more guys than alex and cr... | 20 | ||||||||||||||||
119 | Kem | ... | Chris | i actually get happy to see kem&chris on t... | 20 | ||||||||||||||||
120 | Craig | Camilla | ... | craig is using u camilla no no no #loveisland | 20 | ||||||||||||||||
124 | Craig | Camilla | ... | stg craig if you fuck camilla over am flying t... | 20 | ||||||||||||||||
126 | Craig | Camilla | ... | can't stop shouting craig's a cock whenever he... | 20 | ||||||||||||||||
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
22130 | Kem | ... | you may aswel give kem and amber a split and s... | 20 | |||||||||||||||||
22131 | Camilla | ... | Jonny | camilla better not stick with jonny π πΌ #loveis... | 20 | ||||||||||||||||
22140 | Camilla | ... | Jonny | if camilla sticks with jonny i have 0 cares fo... | 20 | ||||||||||||||||
22141 | Kem | ... | not gonna be able to breathe if kem walks in w... | 20 | |||||||||||||||||
22144 | Kem | Chyna | ... | me right now to kem: please choose chyna, plea... | 20 | ||||||||||||||||
22156 | Montana | Alex | ... | when montana couples up with alex #loveisland ... | 20 | ||||||||||||||||
22165 | Kem | Chyna | ... | might stay in chyna & do a work placement ... | 20 | ||||||||||||||||
22167 | Marcel | ... | Gabby | in absolute bits over gabby and marcel. help m... | 20 | ||||||||||||||||
22170 | Montana | Alex | ... | montana chose happiness\ni'm so here for her &... | 20 | ||||||||||||||||
22171 | Dom | Kem | ... | i feel like kem may come back on his own and d... | 20 | ||||||||||||||||
22173 | Montana | Dom | ... | lol if dom has picked montana π #loveisland | 20 | ||||||||||||||||
22174 | ... | Chris | looove chris and olivia β€οΈ #loveisland | 20 | |||||||||||||||||
22179 | Dom | ... | i kinda hope dom walks in on his own just so h... | 20 | |||||||||||||||||
22181 | Montana | Alex | ... | so happy for montana finally, alex is a dream ... | 20 | ||||||||||||||||
22187 | ... | Chris | i'm rooting for #liv and #chris they've grown ... | 20 | |||||||||||||||||
22196 | Camilla | ... | Jonny | camilla please don't choose jonny #loveisland ... | 20 | ||||||||||||||||
22202 | Kem | ... | i actually felt bad for amber until she said s... | 20 | |||||||||||||||||
22211 | Craig | Camilla | ... | really hope johnny picks camilla and then cami... | 20 | ||||||||||||||||
22215 | ... | Jonny | Tyla | #loveisland camilia is fcking stupid to pick j... | 20 | ||||||||||||||||
22217 | Marcel | ... | Gabby | can't wait for marcel to tell gabby what reall... | 20 | ||||||||||||||||
22221 | Marcel | ... | Gabby | dont get me wrong,we're all gabby &marcel ... | 20 | ||||||||||||||||
22227 | Kem | Chyna | ... | really hope kem walks in with chyna #loveisland | 20 | ||||||||||||||||
22242 | Craig | Camilla | ... | camilla needs to think about herself and choos... | 20 | ||||||||||||||||
22249 | Craig | Camilla | ... | camilla has to choose craig #loveisland | 20 | ||||||||||||||||
22251 | Camilla | ... | Jonny | @sdeptford7 the fact camilla even contemplated... | 20 | ||||||||||||||||
22252 | Camilla | ... | Jonny | camilla, don't even thinking about choosing jo... | 20 | ||||||||||||||||
22263 | Marcel | ... | Gabby | @gabbydawnallen and @marcel_rockyb make me cry... | 20 | ||||||||||||||||
22267 | Marcel | ... | Gabby | my heart breaks for gabby, game or not, marcel... | 20 | ||||||||||||||||
22271 | Kem | ... | looks like kem is gonna give amber the red lig... | 20 | |||||||||||||||||
22272 | Kem | Chyna | ... | kem bouncing in with chyna ππ #loveisland | 20 |
4143 rows Γ 24 columns
import regex as re
def str_join(df, sep, *cols):
from functools import reduce
return reduce(lambda x, y: x.astype(str).str.cat(y.astype(str), sep=sep),
[df[col] for col in cols])
tie = []
csv5['edge'] = str_join(csv5, ',', 'Craig', 'Montana', 'Alex',"Camilla","Marcel", "Dom", "Shannen","Kem", "Chyna", "Ellisha-Jade",
"Olivia", "Amelia", "Danielle", "Amber", "Rob", "Nathan", "Steve","Marino", "Chris",
"Jonny", "Gabby","Tyla")
csv5['edge'] = csv5['edge'].str.replace(",", "")
for index, row in csv5.iterrows():
tie.append(re.sub(r"(\w)([A-Z])", r"\1 \2", row.edge))
#row['edge'] = re.sub(r"(\w)([A-Z])", r"\1 \2", row.edge)
se = pd.Series(tie)
csv5['graph_edge'] = se.values
csv5
Craig | Montana | Alex | Camilla | Marcel | Dom | Shannen | Kem | Chyna | Ellisha-Jade | ... | Steve | Marino | Chris | Jonny | Gabby | Tyla | text | missing | edge | graph_edge | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Craig | Camilla | ... | i really can't believe camilla has fallen for ... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
4 | Craig | Camilla | ... | craig has made camilla lose composure. nah pis... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
9 | ... | Gabby | gutted for gabby but can't wait to see amber g... | 20 | AmberGabby | Amber Gabby | |||||||||||||||
10 | Craig | Camilla | ... | can't wait for the episode that camilla wales ... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
16 | Montana | Alex | ... | alex is peng. the wait was worth was it montan... | 20 | MontanaAlex | Montana Alex | ||||||||||||||
17 | Craig | Camilla | ... | i love that camilla's happy but there's someth... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
22 | Montana | Alex | ... | oh my god, alex talking about montana melts my... | 20 | MontanaAlex | Montana Alex | ||||||||||||||
23 | Camilla | ... | Jonny | everyone moaning about jonny but look how cami... | 20 | CamillaJonny | Camilla Jonny | ||||||||||||||
26 | Montana | Camilla | ... | montana and camilla are friendship goals!!ππ» #... | 20 | MontanaCamilla | Montana Camilla | ||||||||||||||
30 | Craig | ... | Jonny | ngl. but i think cam is forcing this way too m... | 20 | CraigJonny | Craig Jonny | ||||||||||||||
34 | Montana | Camilla | ... | i love the friendship between camilla and mont... | 20 | MontanaCamilla | Montana Camilla | ||||||||||||||
35 | Craig | Camilla | ... | #craig is playing the game! he knows how to ge... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
38 | Craig | Camilla | ... | i swear to the gods, if craig is playing camil... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
49 | Montana | Alex | ... | alex and montana are the cutestππ #loveisland | 20 | MontanaAlex | Montana Alex | ||||||||||||||
54 | Craig | Camilla | ... | but camilla, craig is just another 3 with sung... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
61 | Craig | Camilla | ... | i just feel like somehow we need to send word ... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
64 | Craig | Camilla | ... | still don't trust craig, think he's gone for c... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
71 | Montana | ... | Jonny | so with tonight's twist i'm expecting montana ... | 20 | MontanaJonny | Montana Jonny | ||||||||||||||
86 | Montana | Alex | ... | "she's the whole package." i'm so glad alex se... | 20 | MontanaAlex | Montana Alex | ||||||||||||||
90 | Craig | Camilla | ... | don't trust craig one bit. i feel like a prote... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
92 | Craig | Camilla | ... | just wait until you find out what craig's done... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
98 | Montana | Camilla | ... | can camilla and montanna get together pls, the... | 20 | MontanaCamilla | Montana Camilla | ||||||||||||||
103 | Craig | Camilla | ... | do you think craig has told camilla he has kid... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
108 | Craig | Camilla | ... | no camilla don't fall for it! π±π±π± #cringeycrai... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
109 | Kem | Chyna | ... | kem and chyna is the worst idea to ever exist ... | 20 | KemChyna | Kem Chyna | ||||||||||||||
117 | Craig | Alex | ... | pretty sure there's more guys than alex and cr... | 20 | CraigAlex | Craig Alex | ||||||||||||||
119 | Kem | ... | Chris | i actually get happy to see kem&chris on t... | 20 | KemChris | Kem Chris | ||||||||||||||
120 | Craig | Camilla | ... | craig is using u camilla no no no #loveisland | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
124 | Craig | Camilla | ... | stg craig if you fuck camilla over am flying t... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
126 | Craig | Camilla | ... | can't stop shouting craig's a cock whenever he... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
22130 | Kem | ... | you may aswel give kem and amber a split and s... | 20 | KemAmber | Kem Amber | |||||||||||||||
22131 | Camilla | ... | Jonny | camilla better not stick with jonny π πΌ #loveis... | 20 | CamillaJonny | Camilla Jonny | ||||||||||||||
22140 | Camilla | ... | Jonny | if camilla sticks with jonny i have 0 cares fo... | 20 | CamillaJonny | Camilla Jonny | ||||||||||||||
22141 | Kem | ... | not gonna be able to breathe if kem walks in w... | 20 | KemAmber | Kem Amber | |||||||||||||||
22144 | Kem | Chyna | ... | me right now to kem: please choose chyna, plea... | 20 | KemChyna | Kem Chyna | ||||||||||||||
22156 | Montana | Alex | ... | when montana couples up with alex #loveisland ... | 20 | MontanaAlex | Montana Alex | ||||||||||||||
22165 | Kem | Chyna | ... | might stay in chyna & do a work placement ... | 20 | KemChyna | Kem Chyna | ||||||||||||||
22167 | Marcel | ... | Gabby | in absolute bits over gabby and marcel. help m... | 20 | MarcelGabby | Marcel Gabby | ||||||||||||||
22170 | Montana | Alex | ... | montana chose happiness\ni'm so here for her &... | 20 | MontanaAlex | Montana Alex | ||||||||||||||
22171 | Dom | Kem | ... | i feel like kem may come back on his own and d... | 20 | DomKem | Dom Kem | ||||||||||||||
22173 | Montana | Dom | ... | lol if dom has picked montana π #loveisland | 20 | MontanaDom | Montana Dom | ||||||||||||||
22174 | ... | Chris | looove chris and olivia β€οΈ #loveisland | 20 | OliviaChris | Olivia Chris | |||||||||||||||
22179 | Dom | ... | i kinda hope dom walks in on his own just so h... | 20 | DomOlivia | Dom Olivia | |||||||||||||||
22181 | Montana | Alex | ... | so happy for montana finally, alex is a dream ... | 20 | MontanaAlex | Montana Alex | ||||||||||||||
22187 | ... | Chris | i'm rooting for #liv and #chris they've grown ... | 20 | OliviaChris | Olivia Chris | |||||||||||||||
22196 | Camilla | ... | Jonny | camilla please don't choose jonny #loveisland ... | 20 | CamillaJonny | Camilla Jonny | ||||||||||||||
22202 | Kem | ... | i actually felt bad for amber until she said s... | 20 | KemAmber | Kem Amber | |||||||||||||||
22211 | Craig | Camilla | ... | really hope johnny picks camilla and then cami... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
22215 | ... | Jonny | Tyla | #loveisland camilia is fcking stupid to pick j... | 20 | JonnyTyla | Jonny Tyla | ||||||||||||||
22217 | Marcel | ... | Gabby | can't wait for marcel to tell gabby what reall... | 20 | MarcelGabby | Marcel Gabby | ||||||||||||||
22221 | Marcel | ... | Gabby | dont get me wrong,we're all gabby &marcel ... | 20 | MarcelGabby | Marcel Gabby | ||||||||||||||
22227 | Kem | Chyna | ... | really hope kem walks in with chyna #loveisland | 20 | KemChyna | Kem Chyna | ||||||||||||||
22242 | Craig | Camilla | ... | camilla needs to think about herself and choos... | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
22249 | Craig | Camilla | ... | camilla has to choose craig #loveisland | 20 | CraigCamilla | Craig Camilla | ||||||||||||||
22251 | Camilla | ... | Jonny | @sdeptford7 the fact camilla even contemplated... | 20 | CamillaJonny | Camilla Jonny | ||||||||||||||
22252 | Camilla | ... | Jonny | camilla, don't even thinking about choosing jo... | 20 | CamillaJonny | Camilla Jonny | ||||||||||||||
22263 | Marcel | ... | Gabby | @gabbydawnallen and @marcel_rockyb make me cry... | 20 | MarcelGabby | Marcel Gabby | ||||||||||||||
22267 | Marcel | ... | Gabby | my heart breaks for gabby, game or not, marcel... | 20 | MarcelGabby | Marcel Gabby | ||||||||||||||
22271 | Kem | ... | looks like kem is gonna give amber the red lig... | 20 | KemAmber | Kem Amber | |||||||||||||||
22272 | Kem | Chyna | ... | kem bouncing in with chyna ππ #loveisland | 20 | KemChyna | Kem Chyna |
4143 rows Γ 26 columns
df = csv5['graph_edge'].apply(lambda x: pd.Series(x.split(' ')))
df.to_csv('loveisland.csv', encoding = 'utf-8')
df
0 | 1 | |
---|---|---|
0 | Craig | Camilla |
4 | Craig | Camilla |
9 | Amber | Gabby |
10 | Craig | Camilla |
16 | Montana | Alex |
17 | Craig | Camilla |
22 | Montana | Alex |
23 | Camilla | Jonny |
26 | Montana | Camilla |
30 | Craig | Jonny |
34 | Montana | Camilla |
35 | Craig | Camilla |
38 | Craig | Camilla |
49 | Montana | Alex |
54 | Craig | Camilla |
61 | Craig | Camilla |
64 | Craig | Camilla |
71 | Montana | Jonny |
86 | Montana | Alex |
90 | Craig | Camilla |
92 | Craig | Camilla |
98 | Montana | Camilla |
103 | Craig | Camilla |
108 | Craig | Camilla |
109 | Kem | Chyna |
117 | Craig | Alex |
119 | Kem | Chris |
120 | Craig | Camilla |
124 | Craig | Camilla |
126 | Craig | Camilla |
... | ... | ... |
22130 | Kem | Amber |
22131 | Camilla | Jonny |
22140 | Camilla | Jonny |
22141 | Kem | Amber |
22144 | Kem | Chyna |
22156 | Montana | Alex |
22165 | Kem | Chyna |
22167 | Marcel | Gabby |
22170 | Montana | Alex |
22171 | Dom | Kem |
22173 | Montana | Dom |
22174 | Olivia | Chris |
22179 | Dom | Olivia |
22181 | Montana | Alex |
22187 | Olivia | Chris |
22196 | Camilla | Jonny |
22202 | Kem | Amber |
22211 | Craig | Camilla |
22215 | Jonny | Tyla |
22217 | Marcel | Gabby |
22221 | Marcel | Gabby |
22227 | Kem | Chyna |
22242 | Craig | Camilla |
22249 | Craig | Camilla |
22251 | Camilla | Jonny |
22252 | Camilla | Jonny |
22263 | Marcel | Gabby |
22267 | Marcel | Gabby |
22271 | Kem | Amber |
22272 | Kem | Chyna |
4143 rows Γ 2 columns
data2
Source Target Type weight | |
---|---|
0 | Craig Camilla Undirected 1.0 |
1 | Craig Camilla Undirected 1.0 |
2 | Amber Gabby Undirected 1.0 |
3 | Craig Camilla Undirected 1.0 |
4 | Montana Alex Undirected 1.0 |
5 | Craig Camilla Undirected 1.0 |
6 | Montana Alex Undirected 1.0 |
7 | Camilla Jonny Undirected 1.0 |
8 | Montana Camilla Undirected 1.0 |
9 | Craig Jonny Undirected 1.0 |
10 | Montana Camilla Undirected 1.0 |
11 | Craig Camilla Undirected 1.0 |
12 | Craig Camilla Undirected 1.0 |
13 | Montana Alex Undirected 1.0 |
14 | Craig Camilla Undirected 1.0 |
15 | Craig Camilla Undirected 1.0 |
16 | Craig Camilla Undirected 1.0 |
17 | Montana Jonny Undirected 1.0 |
18 | Montana Alex Undirected 1.0 |
19 | Craig Camilla Undirected 1.0 |
20 | Craig Camilla Undirected 1.0 |
21 | Montana Camilla Undirected 1.0 |
22 | Craig Camilla Undirected 1.0 |
23 | Craig Camilla Undirected 1.0 |
24 | Kem Chyna Undirected 1.0 |
25 | Craig Alex Undirected 1.0 |
26 | Kem Chris Undirected 1.0 |
27 | Craig Camilla Undirected 1.0 |
28 | Craig Camilla Undirected 1.0 |
29 | Craig Camilla Undirected 1.0 |
... | ... |
4113 | Kem Amber Undirected 1.0 |
4114 | Camilla Jonny Undirected 1.0 |
4115 | Camilla Jonny Undirected 1.0 |
4116 | Kem Amber Undirected 1.0 |
4117 | Kem Chyna Undirected 1.0 |
4118 | Montana Alex Undirected 1.0 |
4119 | Kem Chyna Undirected 1.0 |
4120 | Marcel Gabby Undirected 1.0 |
4121 | Montana Alex Undirected 1.0 |
4122 | Dom Kem Undirected 1.0 |
4123 | Montana Dom Undirected 1.0 |
4124 | Olivia Chris Undirected 1.0 |
4125 | Dom Olivia Undirected 1.0 |
4126 | Montana Alex Undirected 1.0 |
4127 | Olivia Chris Undirected 1.0 |
4128 | Camilla Jonny Undirected 1.0 |
4129 | Kem Amber Undirected 1.0 |
4130 | Craig Camilla Undirected 1.0 |
4131 | Jonny Tyla Undirected 1.0 |
4132 | Marcel Gabby Undirected 1.0 |
4133 | Marcel Gabby Undirected 1.0 |
4134 | Kem Chyna Undirected 1.0 |
4135 | Craig Camilla Undirected 1.0 |
4136 | Craig Camilla Undirected 1.0 |
4137 | Camilla Jonny Undirected 1.0 |
4138 | Camilla Jonny Undirected 1.0 |
4139 | Marcel Gabby Undirected 1.0 |
4140 | Marcel Gabby Undirected 1.0 |
4141 | Kem Amber Undirected 1.0 |
4142 | Kem Chyna Undirected 1.0 |
4143 rows Γ 1 columns
data2 = pd.read_csv("loveisland.csv", encoding = 'utf-8')
data3 = data2.groupby(['Source','Target']).sum()
data3
Weight | ||
---|---|---|
Source | Target | |
Alex | Chris | 1 |
Chyna | 2 | |
Dom | 2 | |
Kem | 1 | |
Nathan | 1 | |
Olivia | 1 | |
Amber | Chris | 10 |
Gabby | 61 | |
Jonny | 5 | |
Marino | 2 | |
Nathan | 18 | |
Rob | 8 | |
Tyla | 3 | |
Amelia | Amber | 1 |
Camilla | Amber | 26 |
Chris | 5 | |
Dom | 2 | |
Gabby | 44 | |
Jonny | 479 | |
Kem | 5 | |
Marcel | 25 | |
Olivia | 7 | |
Rob | 1 | |
Tyla | 25 | |
Chris | Gabby | 1 |
Jonny | 1 | |
Chyna | Amber | 27 |
Amelia | 7 | |
Chris | 1 | |
Danielle | 1 | |
... | ... | ... |
Marcel | Dom | 5 |
Gabby | 649 | |
Kem | 9 | |
Olivia | 2 | |
Rob | 2 | |
Shannen | 1 | |
Tyla | 1 | |
Montana | Alex | 227 |
Amber | 3 | |
Camilla | 84 | |
Chris | 4 | |
Dom | 110 | |
Gabby | 5 | |
Jonny | 19 | |
Kem | 2 | |
Marcel | 3 | |
Olivia | 30 | |
Nathan | Chris | 1 |
Marino | 2 | |
Steve | 1 | |
Olivia | Amber | 70 |
Chris | 316 | |
Gabby | 11 | |
Jonny | 2 | |
Rob | 9 | |
Tyla | 1 | |
Rob | Chris | 1 |
Jonny | 2 | |
Marino | 1 | |
Nathan | 2 |
97 rows Γ 1 columns
data3.to_csv('graph2.csv', encoding = 'utf-8')