Wednesday, September 3, 2014

Interacting with files: reading writing, ascii and fits

2014 Python lecture. Part III


It's time to play with files containing data! In this lecture, we'll see how to read and write files (ascii and fits).

  • Reading a simple ASCII file
  • How to treat special rows (comments, header)
    • classical way
    • using numpy.loadtxt
    • using numpy.genfromtxt
  • Dealing with missing data
  • Data in a fixed size format
  • Writing files
    • simple method
  • Pickle files (python format)
  • FITS files
The ipython notebook is there:

https://github.com/Morisset/Python-lectures-Notebooks/blob/master/Notebooks/Interact%20with%20files.ipynb


8 comments: