Skip to content

Python for healthcare modelling and data science

Snippets of Python code we find most useful in healthcare modelling and data science

  • Home
  • The Learning Hospital
  • Titanic Survival Machine Learning
  • GitHub(pdf, py, Jupyter)
  • Publications
  • Contact
  • YouTube

Tag: decimal

64. NumPy: Setting width and number of decimal places in NumPy print output

The function below may be used to set both the number of decimal places and the fixed width of NumPy print out. If no width is given it defaults to zero (no extra padding added). Setting width will ensure alignment of output. Continue reading “64. NumPy: Setting width and number of decimal places in NumPy print output” →

Michael Allen NumPy and Pandas 1 Comment April 15, 2018June 15, 2018 1 Minute

15. Python basics: decimal places in output

Python allows a lot of control over formatting of output. But here we will just look at controlling decimal places of output.

There are some different ways. Here is perhaps the most common (because it is most similar to other languages). Continue reading “15. Python basics: decimal places in output” →

Michael Allen Basic 1 Comment March 22, 2018June 15, 2018 1 Minute
Blog at WordPress.com.