loadtxt and savetxt (Numpy and Matplotlib Basics 2)

Overview

  • the numpy module provides functions for reading and writing arrays (matrices) to text files
    • loadtxt
    • savetxt
  • these are good for saving data files
  • there are some key options you need to know about to use them correctly

loadtxt

  • check the help
  • key options:
    • delimiter
    • skiprow

savetxt

  • check the help
  • key options and defaults:
    • fmt='%0.18e'
    • delimiter=' '
    • newline='\n'
    • header=''