In [21]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['patch.force_edgecolor'] = True
import seaborn as sns
import warnings
warnings.filterwarnings("ignore")
%matplotlib inline

In [22]:
#Gives heatmap of null values
def get_heatmap(df):
    #This function gives heatmap of all NaN values
    plt.figure(figsize=(10,6))
    sns.heatmap(df.isnull(), yticklabels=False, cbar=False, cmap='viridis')
    plt.tight_layout()
    return plt.show()

In [23]:
filepath = 'https://raw.githubusercontent.com/jubins/ML-TwitterBotDetection/master/FinalCode/kaggle_data/'

train_df = pd.read_csv(filepath+'training_data_2_csv_UTF.csv')
test_df_backup = pd.read_csv(filepath+'test_data_4_students.csv', sep='\t')
test_df_backup['id'] = test_df_backup.id.apply(lambda x: int(x))

In [24]:
test_df = test_df_backup
train_bots = train_df[train_df.bot==1]
train_nonbots = train_df[train_df.bot==0]

train_bots['screen_name_binary'] = (train_bots.screen_name.str.contains("bot", case=False)==True)
train_nonbots['screen_name_binary'] = (train_nonbots.screen_name.str.contains("bot", case=False))

training_df = pd.concat([train_bots, train_nonbots])

test_df['screen_name_binary'] = (test_df.screen_name.str.contains("bot", case=False)==True)

In [25]:
#test_df[(test_df.screen_name.str.contains("bot", case=False)==True)] #206 these all are bots
listed_count_df = test_df[(test_df.screen_name.str.contains("bot", case=False)==False)]

final_df = test_df[(test_df.screen_name.str.contains("bot", case=False)==True)] #206 these all are bots
final_df.bot=1
final_df = final_df[['id', 'bot']]
final_df.shape


Out[25]:
(206, 2)

In [26]:
listed_count_df.listed_count = listed_count_df.listed_count.apply(lambda x: 0 if x=='None' else x)
listed_count_df.listed_count = listed_count_df.listed_count.apply(lambda x: int(x))

In [27]:
listed_count_df[listed_count_df.listed_count>16000].shape #these all are nonbots
final_df1 = listed_count_df[listed_count_df.listed_count>16000][['id', 'bot']]
final_df1.bot=0
final_df1.shape
final_df = pd.concat([final_df, final_df1])
final_df.shape


Out[27]:
(300, 2)

In [28]:
verified_df = listed_count_df[listed_count_df.listed_count<16000]

In [29]:
verified_df[verified_df.verified=='TRUE'].shape #these all are nonbots
final_df1 = verified_df[verified_df.verified=='TRUE'][['id', 'bot']]
final_df1.bot=0
final_df = pd.concat([final_df, final_df1])
final_df.shape


Out[29]:
(408, 2)

In [30]:
description_df = verified_df[verified_df.verified!='TRUE']

In [31]:
description_df[description_df.description.str.contains("bot", case=False, na=False)].shape #these all are bots

final_df1 = description_df[description_df.description.str.contains("bot", case=False, na=False)][['id', 'bot']]
final_df1.bot=1
final_df = pd.concat([final_df, final_df1])
final_df.shape


Out[31]:
(454, 2)

In [32]:
status_df = description_df[description_df.description.str.contains("bot", case=False, na=False)==False]

In [33]:
status_df[status_df.status.str.contains("bot", case=False, na=False)].shape #these all are bots
final_df1 = status_df[status_df.status.str.contains("bot", case=False, na=False)][['id', 'bot']]
final_df1.bot=1
final_df = pd.concat([final_df, final_df1])
final_df.shape


Out[33]:
(470, 2)

In [34]:
buzzfeed_df = status_df[status_df.status.str.contains("bot", case=False, na=False)==False]

buzzfeed_df[buzzfeed_df.description.str.contains("buzzfeed", case=False, na=False)].shape #these all are nonbots

final_df1 = buzzfeed_df[buzzfeed_df.description.str.contains("buzzfeed", case=False, na=False)][['id','bot']]
final_df1.bot=0
final_df = pd.concat([final_df, final_df1])
final_df.shape


Out[34]:
(486, 2)

In [35]:
name_df = buzzfeed_df[buzzfeed_df.description.str.contains("buzzfeed", case=False, na=False)==False]
condition = (name_df.name.str.contains("bot", case=False, na=False)) | (name_df.screen_name.str.contains("b0t", case=False, na=False))
name_df[condition].shape #these all are bots

final_df1 = name_df[condition][['id','bot']]
final_df1.bot=1
final_df = pd.concat([final_df, final_df1])
final_df.shape


Out[35]:
(492, 2)

In [43]:
truth_df = name_df[(name_df.name.str.contains("bot", case=False, na=False))==False] #shape: 83

condition = ((truth_df.screen_name.str.contains("truth", case=False, na=False)) | 
            (truth_df.name.str.contains("truth", case=False, na=False)) | 
            (truth_df.screen_name.str.contains("anony", case=False, na=False)))

truth_df[condition].shape #these all are bots

final_df1 = truth_df[condition][['id','bot']]
final_df1.bot=1
final_df = pd.concat([final_df, final_df1])
final_df.shape


Out[43]:
(504, 2)

In [44]:
statuses_count_df = truth_df[~condition]
condition = ((statuses_count_df.description.str.contains('cannabis', case=False, na=False)) | (statuses_count_df.description.str.contains('mishear', case=False, na=False))) #these all are bots
statuses_count_df[condition]


Out[44]:
id id_str screen_name location description url followers_count friends_count listed_count created_at ... verified statuses_count lang status default_profile default_profile_image has_extended_profile name bot screen_name_binary
16 42382447 42382447 Agostinozoida Agostinozoida Agostinozoida https://t.co/2gdWyQjNq4 964 331 15 5/25/2009 10:02 ... FALSE 6389 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE TRUE laughkommander NaN False
17 43993280 43993280 AhmedBharoocha NaN I forget to tweet https://t.co/iM3lj0uBHg 5254 2407 102 6/1/2009 22:44 ... FALSE 3392 en {'place': None, 'retweeted_status': {'place': ... TRUE FALSE TRUE Ahmed Bharoocha NaN False
45 401790812 401790812 AveryFunny Los Angeles Actor Comedian Keys. Funny Or Die. Comedy Cent... https://t.co/2KY9WXbjaI 2446 1823 28 10/31/2011 2:52 ... FALSE 2386 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE FALSE Avery Pearson NaN False
56 827983208 827983208 benkreimer United States I'm a free-range journalism technologist worki... http://t.co/4575W1RLCd 1116 422 101 Mon Sep 17 00:01:57 +0000 2012 ... FALSE 261 en {'created_at': 'Fri Apr 07 21:12:12 +0000 2017... TRUE FALSE FALSE Ben Kreimer NaN False
57 72878717 72878717 bglading Nashville, TN Founder-Candid Career, LLC http://t.co/ofQIjeU4TI 82 77 0 9/9/2009 15:32 ... FALSE 5 en {'place': None, 'retweeted': False, 'favorited... TRUE FALSE FALSE billy glading NaN False
59 43091065 43091065 bigangcomic Los Angeles Award Winning Comedian and Actor for inquiries... https://t.co/bCxywQFuwr 5782 6331 123 5/28/2009 11:25 ... FALSE 4901 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Angelo Tsarouchas NaN False
65 783048890 783048890 bnels13 be kind | Insta: bnels_ https://t.co/bpIMp2bLwF 1250 925 2 8/26/2012 19:29 ... FALSE 4970 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE TRUE bailee NaN False
66 274656070 274656070 bobzany Comedy Club near you Bay-bee! What hasn't he done... http://t.co/8nrXLhd6aK 21865 701 173 3/30/2011 19:34 ... FALSE 6518 en {'place': None, 'retweeted_status': {'place': ... TRUE FALSE TRUE Bob Zany NaN False
80 26436076 26436076 Bradymatthews13 iPhone: 32.762235,-117.213986 My arms look fat. NaN 1507 557 32 3/25/2009 5:10 ... FALSE 5925 en {'place': {'attributes': {}, 'country_code': '... FALSE FALSE FALSE Brady Matthews NaN False
85 165500655 165500655 brianwohl Los Angeles I like Fun. Let's make Fun. - Octavarius/Wrest... https://t.co/JzR6lAEunJ 951 1110 18 7/11/2010 19:12 ... FALSE 3303 en {'place': None, 'retweeted': False, 'favorited... TRUE FALSE FALSE Brian Wohl NaN False
88 21627372 21627372 BrittneRose North Hollywood, Los Angeles Aspiring writer and lover of all things celebr... https://t.co/wAGCtJoiZK 243 1100 5 2/23/2009 3:27 ... FALSE 5034 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE FALSE Brittne Rehrauer NaN False
90 203188566 203188566 Brucehills Montreal COO of Just For Laughs http://t.co/acAX8azurT 2710 1472 45 10/15/2010 18:39 ... FALSE 5691 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Bruce Hills NaN False
92 331370908 331370908 bryandey Texan in Los Angeles Comedian-Actor-Texan-Host of Knuckles & Chuckl... https://t.co/HInqoiX4K0 495 214 13 7/8/2011 2:21 ... FALSE 5858 en {'place': None, 'retweeted': False, 'favorited... TRUE FALSE FALSE Bryan Dey 🕆✡ NaN False
102 770626380 770626380 charliegorrilla NaN NaN NaN 111 38 0 8/21/2012 2:03 ... FALSE 211 en {'place': None, 'retweeted': False, 'favorited... TRUE FALSE FALSE Charlie Gorrilla NaN False
104 459483899 459483899 Chris_arnade Driving, driving, driving.... I write about addiction, poverty, & other desp... https://t.co/WYGkUmOmUc 66304 471 1147 1/9/2012 18:30 ... FALSE 61849 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE FALSE Chris Arnade NaN False
113 94707303 94707303 ComedianJerryG Big Bad Huntington Park! Jerry G from HP is Freakin Tweeting! NaN 1216 300 7 12/5/2009 2:48 ... FALSE 2879 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE TRUE Jerry Garcia NaN False
121 17822889 17822889 CrystalMoselle Coasting Filmmaker Director of The Wolfpack https://t.co/nSePmnhx4v 3928 611 0 12/3/2008 0:04 ... FALSE 3771 en {'place': {'attributes': {}, 'country_code': '... FALSE FALSE FALSE CrystalMoselle NaN False
127 18695035 18695035 Dantethecomic Director of Bro What Happened? Movie director/Comic LAST COMIC STANDING/Actor... https://t.co/Yii3woKHeB 61464 41274 174 1/6/2009 20:59 ... FALSE 15856 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE TRUE Dantethecomic NaN False
139 1104552637 1104552637 DelanieFischer Los Angeles, CA Comedian | Writer. Netflix, Hulu, NBC, FOX, VH... https://t.co/zMByn9RPUb 3538 730 140 1/19/2013 20:05 ... FALSE 2944 en {'place': {'attributes': {}, 'country_code': '... FALSE FALSE TRUE Delanie Fischer NaN False
142 30268626 30268626 DinoArchie LA VanCity Fresno Harry Rosen Jimmy Kimmel Live, Adam Devine's House Party, ... https://t.co/1U4rq36vY0 2366 452 0 4/10/2009 17:44 ... FALSE 5566 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Stean The Beloved NaN False
143 31127587 31127587 DNealz NYC.LA Stand Up Comedian, Host of 'Sex Actually'- a d... https://t.co/XOaSQDJk2q 22717 21679 88 4/14/2009 14:01 ... FALSE 8948 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Dave Neal NaN False
148 103768104 103768104 dwcomedy Los Angeles 25 • Comedian • Mexican • Argentinian • Jew https://t.co/9B6Q4wmnEb 1567 229 13 1/11/2010 5:30 ... FALSE 1712 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE FALSE Daniel Weingarten NaN False
149 24946505 24946505 dyllyp bay area | los angeles write my curses in cursive NaN 17235 662 130 3/17/2009 20:20 ... FALSE 46150 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE TRUE dylan NaN False
156 315519939 315519939 emilycampanelli instagram- emilycampanelli Livin' NaN 641 552 3 6/12/2011 0:58 ... FALSE 33 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE emily NaN False
159 24568975 24568975 EricBlackmon Los Angeles Portrait/Entertainment/Sunset Photographer. Vi... https://t.co/ZzK8rPww2Z 4452 202 84 3/15/2009 19:13 ... FALSE 2359 en {'place': {'attributes': {}, 'country_code': '... FALSE FALSE FALSE Eric Blackmon NaN False
161 1360627633 1360627633 EricRevisBass NaN NaN http://t.co/nsVDo4x9BD 1082 249 18 4/18/2013 0:01 ... FALSE 227 en {'place': None, 'retweeted_status': {'place': ... TRUE FALSE FALSE Eric Revis NaN False
163 21323153 21323153 EsauMcgraw Big Boss - Floss Angeles HBO Def Comedy Jam, B.E.T. One Mic Stand, Mart... NaN 7100 2816 79 2/19/2009 18:14 ... FALSE 11385 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE FALSE 1960 What? 1960 Who? NaN False
187 168837454 168837454 Hahneric Los Angeles CA Pretty gay. Nice guy but kind of profane. Grea... https://t.co/bfRrCThIuq 4485 1655 54 7/20/2010 22:39 ... FALSE 9677 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Eric Hahn NaN False
193 53471080 53471080 heysamemerson Los Angeles, CA I'm a cool lady (pretty sure!) https://t.co/bA0dPGXxLS 856 467 9 7/3/2009 19:13 ... FALSE 4204 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE FALSE Sam Emerson NaN False
194 3762458901 3762458901 heytishlaw New York, USA Baby lawyer. Opinions my own. NaN 227 317 8 9/24/2015 17:49 ... FALSE 837 en {'place': None, 'retweeted_status': {'place': ... TRUE FALSE FALSE Sarah Tishler NaN False
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
315 754892000000000000 7.55E+17 mo_abhat Los Angeles, CA NaN NaN 55 43 0 7/18/2016 4:14 ... FALSE 29 en {'place': None, 'retweeted': False, 'favorited... TRUE FALSE TRUE Mo Abhat NaN False
317 64459603 64459603 MONROK Los Angeles, CA Just pull out. That shit works. http://t.co/GsNc6EAlzH 1331 530 39 8/10/2009 17:30 ... FALSE 1046 en {'place': None, 'retweeted': False, 'favorited... TRUE FALSE FALSE MONROK NaN False
320 133404204 133404204 mrmarkmillar Scotland/ United States Writer of Civil War, Old Man Logan, Kick-Ass, ... http://t.co/Q4veuDaKbw 82000 3358 2078 4/15/2010 18:01 ... FALSE 44359 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Mark Millar NaN False
324 26658046 26658046 MyNameisRazzle2 Funsville Comedian/Writer. CoHost of The Franchise movie... https://t.co/m6nL6Z3t18 51262 1664 2222 3/26/2009 1:48 ... FALSE 19998 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE TRUE Razzle C-137 NaN False
329 253321807 253321807 NatTenerelli Los Angeles LA Clippers Dance Squad Thursdays @ 8/7c on E!... https://t.co/pilJnUOsMi 8976 318 251 2/17/2011 0:44 ... FALSE 1637 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE TRUE Natalie Tenerelli NaN False
339 59775065 59775065 nick_paley brooklyn, ny I'm Nick https://t.co/W7uAPX9PBn 254 409 5 7/24/2009 12:55 ... FALSE 35 en {'place': None, 'retweeted_status': {'place': ... TRUE FALSE FALSE Nick Paley NaN False
340 55752358 55752358 NickGoossen Los Angeles I don't even know no loud crash... https://t.co/fLDoQK3967 3691 882 69 7/11/2009 4:00 ... FALSE 5962 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Nicholaus Goossen NaN False
343 22342898 22342898 NikkiLimo The Hood I just wanna do a good job. https://t.co/fIyKKYSagM 34002 2187 308 3/1/2009 8:13 ... FALSE 5872 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Nikki Limo NaN False
345 2561646679 2561646679 NoceraBV New York City Columnist for Bloomberg View. Co-author of "Al... https://t.co/SUak8HM8Zp 10579 890 270 6/11/2014 16:12 ... FALSE 4385 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE TRUE Joe Nocera NaN False
354 129942953 129942953 OceanLive ÜT: 34.038736,-118.389997 I'm here 2 take over the world 1 joke @ a time... https://t.co/Gp2HFEWwKZ 1349 170 24 4/5/2010 21:41 ... FALSE 15184 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Ocean Glapion NaN False
362 84083187 84083187 OzKaterji İstanbul, Türkiye Journalist, Writer and Filmmaker. Focus on the... https://t.co/vvsYFTtco3 9872 5981 334 10/21/2009 13:42 ... FALSE 55059 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE TRUE Oz Katerji NaN False
365 71978637 71978637 PamelaEPrice Los Angeles, CA Journalist. VP of https://t.co/LjtMBssSJl @LAT... https://t.co/knINejdVNe 1741 1319 18 9/6/2009 6:01 ... FALSE 1584 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Pamela Price NaN False
366 4855815726 4855815726 PartyBitchKayla Los Angeles, CA Jesus, nails, and entreperneurship https://t.co/X3fPJIBigI 18378 116 52 2/3/2016 21:40 ... FALSE 512 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE TRUE PartyBitchKayla NaN False
369 903162031 903162031 paulelianiceguy Los Angeles Ca. Actor #Netflix #ABC #TNT #InnovativeArtists Co... https://t.co/9KQcnf6P0I 11163 6419 85 10/25/2012 3:51 ... FALSE 4769 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Paul Elia NaN False
371 23652567 23652567 PaulHughescomic Full time Fantasy Land USA All things from the perspective of my 7 year o... http://t.co/7jbMEHpaXU 566 90 13 3/10/2009 20:42 ... FALSE 1147 en {'place': {'attributes': {}, 'country_code': '... FALSE FALSE FALSE lil p NaN False
375 1273164162 1273164162 plbds New York Political Economist (& social malcontent).\nAs... https://t.co/WUT9fe5y4H 581 229 20 3/16/2013 19:58 ... FALSE 2684 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Paulo L dos Santos NaN False
383 35408870 35408870 pulmyears California, USA Official, Vilified Account for Paul Myers: Jou... https://t.co/tm0jvYI1fL 10998 4901 384 4/26/2009 5:09 ... FALSE 132219 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Paul Myers NaN False
406 22338630 22338630 rickyvanveen Chelsea, NYC Facebook/CollegeHumor/Vimeo/BustedTees/some ot... http://t.co/G7auLi75nE 21941 176 233 3/1/2009 6:29 ... FALSE 1187 en {'place': None, 'retweeted': False, 'favorited... TRUE FALSE FALSE Ricky Van Veen NaN False
415 22166136 22166136 salgentile New York, NY Comedy writer. Late Night with Seth Meyers. Se... https://t.co/Zw7hLV0I7Z 3819 1232 148 2/27/2009 17:46 ... FALSE 4511 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE TRUE Sal Gentile NaN False
418 342347053 342347053 sansdn Sydney Angry buddhist and feminist. I study gender po... NaN 6567 508 112 7/25/2011 21:34 ... FALSE 37364 en {'place': None, 'retweeted_status': {'place': ... FALSE FALSE TRUE San NaN False
424 549264466 549264466 scarriewhite new york/san diego writer and glitter enthusiast who pretends to ... https://t.co/UasYOX10Gy 498 767 10 4/9/2012 14:18 ... FALSE 12096 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE TRUE rachel meghan NaN False
425 291227271 291227271 scharf_michael los angeles ...is very good at drawing basketballs. NaN 265 355 3 5/1/2011 17:18 ... FALSE 147 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Michael NaN False
433 3199884297 3199884297 sfmarketupdate San Francisco, CA San Francisco Real Estate Agent https://t.co/GMIpWKVOId 49037 43 1 4/24/2015 3:33 ... FALSE 132 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Jess Williams NaN False
440 70727809 70727809 Simmydk South Africa Model and Actress | Cover Girl | Motivational ... https://t.co/rsMwuSAH6C 4214 826 42 9/1/2009 16:59 ... FALSE 3398 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE TRUE Simone Dawn De Kock NaN False
471 97762747 97762747 TheBurnham Los Angeles! Ack! I'm the #1 New York Times Bestselling Artist o... https://t.co/wvkW8aRZlN 18455 854 533 12/18/2009 22:36 ... FALSE 35365 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE Chris Burnham NaN False
476 21623813 21623813 TheJeffRichards NaN Comedian / Actor / Singer / Impressionist / #S... https://t.co/qEpStfjktt 3677 1477 77 2/23/2009 2:31 ... FALSE 5053 en {'place': None, 'retweeted_status': {'place': ... TRUE FALSE FALSE Jeff Richards NaN False
478 3341453481 3341453481 TheJoshMeyers NaN NaN NaN 2855 96 0 6/22/2015 14:58 ... FALSE 198 en {'place': None, 'retweeted': False, 'favorited... TRUE FALSE FALSE Josh Meyers NaN False
543 360945774 360945774 TysonCBeckford Worldwide NaN NaN 95571 600 449 8/24/2011 0:43 ... FALSE 26502 en {'place': None, 'retweeted': False, 'favorited... FALSE FALSE FALSE TysonC NaN False
553 332888068 332888068 VinnyFasline Los Angeles, CA Stand up Comedian / Actor. IG/Snapchat - vinny... http://t.co/MsK9wyuzUi 892 355 16 7/10/2011 16:11 ... FALSE 1028 en {'place': None, 'retweeted': False, 'favorited... TRUE FALSE FALSE Vinny Fasline NaN False
561 16712547 16712547 xojustina NaN motion picture still photographer // motion pi... https://t.co/sILd4oZm98 297 191 12 10/12/2008 21:56 ... FALSE 296 en {'place': {'attributes': {}, 'country_code': '... FALSE FALSE FALSE Justina Mintz NaN False

77 rows × 21 columns


In [208]:
statuses_count_df[~condition].shape


Out[208]:
(77, 21)

In [209]:
final_df1 = statuses_count_df[~condition][['id','bot']] #these all are nonbots
final_df1.bot=0
final_df = pd.concat([final_df, final_df1])
final_df.shape


Out[209]:
(575, 2)

In [210]:
#preparing subission file
final_df.to_csv('submission.csv', index=False)

#2381315456, 159966364

In [ ]: