Python Forum
save 2d array to file and load back
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
save 2d array to file and load back
#4
You can convert y to list using .tolist() method, e.g.

y = np.loadtxt('text.txt', dtype=np.object)
y = y.tolist()
Another way is to use standard pickle module.
Reply


Messages In This Thread
save 2d array to file and load back - by ian - May-18-2018, 02:29 AM
RE: save 2d array to file and load back - by scidam - May-18-2018, 03:00 AM
RE: save 2d array to file and load back - by ian - May-18-2018, 04:44 AM
RE: save 2d array to file and load back - by scidam - May-18-2018, 05:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [solved] Save a matplotlib figure into hdf5 file paul18fr 1 2,472 Jun-08-2021, 05:58 PM
Last Post: paul18fr
  Fatal Python error: initfsencoding: unable to load the file system codec gauravbhardwajee 12 28,036 Apr-30-2020, 07:45 PM
Last Post: barrpath
  Read file Into array with just $0d as Newline lastyle 5 3,311 Feb-03-2020, 11:58 PM
Last Post: lastyle
  Send array of doubles to Python from C and back baptiste 8 8,618 Jan-10-2020, 05:02 PM
Last Post: cencen_cj
  Corrupted numpy arrays when save to file. DreamingInsanity 2 3,187 Dec-14-2019, 12:12 PM
Last Post: DreamingInsanity
  save my sensor data from the bme680 into a json or csv file Plastefuchs84 1 3,105 Aug-23-2019, 03:04 AM
Last Post: Plastefuchs84
  Is there a way to save a CSV file as a python object amjass12 4 2,681 Jul-16-2019, 12:00 PM
Last Post: amjass12
  Is there any way to properly load fixed width file into a dataframe using Pandas? vicky53 1 3,034 Mar-29-2019, 06:04 PM
Last Post: Larz60+
  Load .abf file and for analysis with Pandas finalcode 0 2,983 Nov-10-2018, 09:51 AM
Last Post: finalcode
  loading a 3D array from a bin file Mark3232 1 4,667 May-04-2018, 11:36 AM
Last Post: j.crater

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020