Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.