Re: [Numpy-discussion] [SciPy-User] Why slicing Pandas column and then subtract gives NaN?

2019-02-15 Thread Daniele Nicolodi
On 15-02-2019 14:48, C W wrote: > Fair enough. Python has been called the #1 language for data science. If > I'm slicing a[2:5] out of range, why not throw an error. This is> > disappointing! No one here is trying to convince you to use Python. If you don't like it, don't use it. Complain in this

Re: [Numpy-discussion] [SciPy-User] Why slicing Pandas column and then subtract gives NaN?

2019-02-15 Thread C W
Fair enough. Python has been called the #1 language for data science. If I'm slicing a[2:5] out of range, why not throw an error. This is disappointing! I mean, why would you design a language to slice outside of range? Also, no other language I know have this strange behavior. On Fri, Feb 15, 20

Re: [Numpy-discussion] [SciPy-User] Why slicing Pandas column and then subtract gives NaN?

2019-02-15 Thread Paul Hobson
On Fri, Feb 15, 2019 at 5:12 AM Mike C wrote: > The original data was in CSV format. I read it in using pd.read_csv(). It > does have column names, but no row names. I don’t think numpy reads csv > files. > If you read a file into a pandas structure, it will have row labels. The default labels a

Re: [Numpy-discussion] [SciPy-User] Why slicing Pandas column and then subtract gives NaN?

2019-02-15 Thread Andras Deak
> The original data was in CSV format. I read it in using pd.read_csv(). It > does have column names, but no row names. I don’t think numpy reads csv files I routinely read csv files using numpy.loadtxt https://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html > And also, when I do

Re: [Numpy-discussion] [SciPy-User] Why slicing Pandas column and then subtract gives NaN?

2019-02-15 Thread Mike C
The original data was in CSV format. I read it in using pd.read_csv(). It does have column names, but no row names. I don’t think numpy reads csv files. And also, when I do a[2:5]-b[:3], it does not throw any “index out of range” error. I was able to catch that, but in both Matlab and R. You get

Re: [Numpy-discussion] [SciPy-User] Why slicing Pandas column and then subtract gives NaN?

2019-02-15 Thread Juan Nunez-Iglesias
> I don’t have index when I read in the data. I just want to slice two series > to the same length, and subtract. That’s it! > > I also don’t what numpy methods wrapped within methods. They work, but hard > do understand. > > How would you do it? In Matlab or R, it’s very simple, one line. Wh