I'm using ipython 4.0.1 and python 3.5.1, when I call np.c_(), it shows an error
CClass object is not callable.
This is my code:
import numpy as np
rows = []
with open('ntumlone.dat') as f:
rows = [list(map(float, L.split())) for L in f]
arr = np.array(rows)
date = np.c_(np.ones(len(arr)), arr)
What's wrong with me?
Try
date = np.c_[np.ones(len(arr)), arr]
Check its docs. You 'call' it with square brackets, as though you are indexing, not with (). If the distinction is too confusing stick with concatenate or one of the stack functions. I think in this use it is the same as vstack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With