1c0433bcd6928e55ee70e582fd538c3bc854d04e,examples/models/population_server.py,,update_pyramid,#,87
Before Change
male = pyramid[pyramid.Sex == "Male"]
female = pyramid[pyramid.Sex == "Female"]
total = male.Value.sum() + female.Value.sum()
male_percent = -male.Value / total
female_percent = female.Value / total
groups = male.AgeGrpStart.tolist()
shifted = groups[1:] + [groups[-1] + 5]
source_pyramid.data = dict(
groups=groups,
shifted=shifted,
male=male_percent,
female=female_percent,
)
def update_population():
population = df[df.Location == location].groupby(df.Year).Value.sum()
After Change
group=[str(x) for x in male.AgeGrp.unique()],
value=male_percent,
)
source_pyramid_f.data = dict(
group=[str(x) for x in female.AgeGrp.unique()],
value=female_percent,
)
def update_population():
population = df[df.Location == location].groupby(df.Year).Value.sum()
aligned_revision = revision // 10 * 10
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: bokeh/bokeh
Commit Name: 1c0433bcd6928e55ee70e582fd538c3bc854d04e
Time: 2017-01-09
Author: bryanv@continuum.io
File Name: examples/models/population_server.py
Class Name:
Method Name: update_pyramid
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: a156be457c3f7d68bc98e4505871d14cd1c45c53
Time: 2017-04-05
Author: jonwayne@google.com
File Name: vision/cloud-client/face_detection/faces_test.py
Class Name:
Method Name: test_main
Project Name: bokeh/bokeh
Commit Name: 1c0433bcd6928e55ee70e582fd538c3bc854d04e
Time: 2017-01-09
Author: bryanv@continuum.io
File Name: examples/embed/widget.py
Class Name:
Method Name: update_pyramid