Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Aug 22, 2022
1 parent da79886 commit 0f08a80
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions benfordslaw/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
bl = benfordslaw(pos=-1)
# USA example
df = bl.import_example(data='USA')
Iloc = df['candidate']=='Donald Trump'
X = df['votes'].loc[Iloc].values

results = bl.fit(X)
# Plot
bl.plot(title='Donald Trump', barcolor=[0.5, 0.5, 0.5], fontsize=12, barwidth=0.4)
Expand All @@ -115,6 +118,9 @@
bl = benfordslaw(pos=-2)
# USA example
df = bl.import_example(data='USA')
Iloc = df['candidate']=='Donald Trump'
X = df['votes'].loc[Iloc].values

results = bl.fit(X)
# Plot
bl.plot(title='Donald Trump', barcolor=[0.5, 0.5, 0.5], fontsize=12, barwidth=0.4)
Expand Down

0 comments on commit 0f08a80

Please sign in to comment.