# Best method for saving an array for post-processing

**URL:** <https://community.freefem.org/t/best-method-for-saving-an-array-for-post-processing/2901>\
**Category:** General Discussion\
**Created:** [January 22, 2024, 2:25pm UTC](https://community.freefem.org/t/best-method-for-saving-an-array-for-post-processing/2901 "2024-01-22T14:25:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jna1g18](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Post date:** [January 22, 2024, 2:25pm UTC](https://community.freefem.org/t/best-method-for-saving-an-array-for-post-processing/2901/1 "2024-01-22T14:25:17Z")

</div>

Hi all, could someone outline the best way to save an array of values resulting from a simulation for post-processing? I’m currently saving the array as a .txt file and then simply copy and pasting them into Python where I can then plot them, but the issue I’m having is that the values that appear in the .txt file are rounded such that only 6 significant figures are ever displayed, thus some information is lost. Is there some kind of way to save an array such that it may be directly opened in Python, without the loss of information along the way?

I found something in section 4.6.12 of the documentation which I think is what I’m looking for and that is the `.precision(n)` function, which lets the user set the precision of the printed value. However, I’m not entirely sure of how to use it with the `ofstream` function or with `cout`, so any pointers would be really appreciated! Please say if my question is not clear.

---

<div class="post-metadata">

**Author:** ![jna1g18](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Post date:** [January 22, 2024, 4:12pm UTC](https://community.freefem.org/t/best-method-for-saving-an-array-for-post-processing/2901/2 "2024-01-22T16:12:20Z")

</div>

Never mind, I think I’ve sorted it!
