Skip to content

Instantly share code, notes, and snippets.

@talfco
Created February 10, 2019 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talfco/fd34b0f8bf75fed2bfa4307b1899e37d to your computer and use it in GitHub Desktop.
Save talfco/fd34b0f8bf75fed2bfa4307b1899e37d to your computer and use it in GitHub Desktop.
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