Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Type Error in the First Coin Flipping Algorithm in Chapter 1 #577

Open
@lorenzo8612

Description

In Chapter 1 (Ch1_Introduction_PyMC2.ipynb) there's a type error in the first coin flipping algorithm (Example: Mandatory coin-flip example) at line:
sx = plt.subplot(len(n_trials) / 2, 2, k + 1) inside the for-cycle.
The operation len(n_trials) / 2 gives back a float and not an integer (at least in the current version of Colab).

It can be fixed by adding int():
sx = plt.subplot(int(len(n_trials) / 2), 2, k + 1)

Edit:
Or more simply with len(n_trials) // 2 as Lucian Sasu suggested:
sx = plt.subplot(len(n_trials) // 2, 2, k + 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /