S
S
Sergey30302020-03-10 15:41:41
Python
Sergey3030, 2020-03-10 15:41:41

How to get a vecor column consisting of the derivative of one array column with respect to another column?

I have a two dimensional array

0.0, 1
1.0, 2
2.0, 3
2.5, 4


How to get a column vecor consisting of the derivative of the second column with respect to the first?
0
1
1
2

Or
1
1
2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Dugin, 2020-03-11
@Sergey3030

np.diff(a[:, 1]) / np.diff(a[:, 0])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question