0

I would like to start managing my Fortran data using the power of python. In Fortran90, it's straightforward to write the results in binary. For instance, I save an array in a binary file and I would like to read it and do some statistics in python. What is the correct way of doing this?

6
  • 3
    Use NumPy for number crunching in Python. Commented Dec 6, 2013 at 19:13
  • 2
    @larsmans: Your comment appears irrelevant. OP is asking about how to go about reading Fortran "binary" data into Python, not how to process said data. Commented Dec 6, 2013 at 19:18
  • 1
    @KyleKanos: NumPy also has facilities for I/O and interop with Fortran libraries. Commented Dec 6, 2013 at 20:43
  • 1
    @larsmans: I know it does, but your comment was about "number crunching" not file IO, hence the claim it is irrelevant. Commented Dec 6, 2013 at 21:12
  • 2
    @larsmans: Again, your initial comment has nothing to do with file IO that the OP is asking for. You are trying to recover a battle you lost 2 hours ago, please stop and admit (to yourself, I don't care for a reply) your comment was irrelevant. Commented Dec 6, 2013 at 21:28

2 Answers 2

1

The module fortranfile offers a very convenient way of reading binary Fortran files. Requires numpy.

Sign up to request clarification or add additional context in comments.

Comments

0

This page may help: http://stromberg.dnsalias.org/~strombrg/converting-binary.html

In short, binary data is best avoided, but the page still talks about ways of dealing with it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.