Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.chararray.tofile

chararray.tofile(fid,sep="",format="%s")

Write array to a file as text or binary (default).

Data is always written in ‘C’ order, independent of the order ofa.The data produced by this method can be recovered using the functionfromfile().

Parameters:

fid : file or str

An open file object, or a string containing a filename.

sep : str

Separator between array items for text output.If “” (empty), a binary file is written, equivalent tofile.write(a.tobytes()).

format : str

Format string for text file output.Each entry in the array is formatted to text by first convertingit to the closest Python type, and then using “format” % item.

Notes

This is a convenience function for quick storage of array data.Information on endianness and precision is lost, so this method is not agood choice for files intended to archive data or transport data betweenmachines with different endianness. Some of these problems can be overcomeby outputting the data as text files, at the expense of speed and filesize.

Previous topic

numpy.chararray.title

Next topic

numpy.chararray.tolist

  • © Copyright 2008-2009, The Scipy community.
  • Last updated on Jun 10, 2017.
  • Created usingSphinx 1.5.3.

[8]ページ先頭

©2009-2025 Movatter.jp