This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_party_friends_count_bar_chart(self, df): | |
data = [ | |
go.Bar( | |
x=df.Party, # assign x as the dataframe column 'x' | |
y=df.FriendsCount | |
) | |
] | |
py.plot(data, filename=self.__country_code+'-tw-party_politicans_count') | |
def create_party_politicans_count_pie_chart(self, df): | |
trace = go.Pie(labels=df.Party, values=df.PartyCount, | |
hoverinfo='label+percent', textinfo='value', | |
title="Twitter User per Party", titlefont=dict( | |
family='Courier New, monospace', | |
size=14, | |
color='#7f7f7f' | |
)) | |
data = [trace] | |
py.plot(data, filename=self.__country_code+'-tw-party_friends_count') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment