22
25

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

numpy配列をCSV出力する

Posted at

初投稿。
最近pythonを使い始めた。
主に科学技術計算のために使おうと思っているのだが、今回は手始めにnumpy.arrayの配列データをCSVに出力する方法をメモする。

test01.py
import numpy as np
#例としてsinカーブを作る
x = np.linspace(-5,5,100)
y = np.sin(x)

data = np.c_[x,y]

#csvファイルとして保存
np.savetxt('out.csv',data,delimiter=',')


22
25
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
25

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?