Category : pandas

I have a dataset with some missing data. I would like to maintain the missingness within the data while performing pd.get_dummies(). Here is an example dataset: Table 1. someCol A B NA C D I would expect pd.get_dummies(df, dummy_na=True)) to transform the data into something like this: Table 2. someCol_A someCol_B someCol_NA someCol_C someCol_D 1 ..

Read more

I have following code that prints the output on console, But along with follower and friend account name, I need the screenname of the user account. Following code works well for one screen_name provided I need to collect follower and following account for multiple users along with screenname of user. for user in tweepy.Cursor(api.followers, screen_name="Billgates").items(): ..

Read more

my graph couldn’t change. when I try to use y_sel and x_sel in the plot it throws error. sometimes it says value error ‘Countries’ and some time too many inputs for one value something like that. ydata = online_act_major.loc[ : , [‘socionet’, ‘info_good_serv’,’banking’,’selling’,’news’,’learn_act’] ] xdata = online_act_major.index.values # gca stands for ‘get current axis’ dropdown ..

Read more