LoginSignup
0
0

More than 5 years have passed since last update.

Numpy > [np.append(x, 0.0) for x in g1]

Last updated at Posted at 2018-03-12
動作環境
ideone Python3 (python 3.5)

https://github.com/bsumlin/PyMieScatt/blob/master/PyMieScatt/Mie.py
のMieQ()の下記は何をしているのだろうか?

g1 = [np.append(x, 0.0) for x in g1]

試してみた。

import numpy as np

g1 = [3.14, 1.59, 2.65, 3.58]
print(g1)
g1 = [np.append(x, 0.0) for x in g1]
print(g1)
run
[3.14, 1.59, 2.65, 3.58]
[array([ 3.14,  0.  ]), array([ 1.59,  0.  ]), array([ 2.65,  0.  ]), array([ 3.58,  0.  ])]

2列にしたうえで、追加された列に0.0を入れているようだ。

link

0
0
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
0
0