What is the meaning of 10j in b = np.r_[3,[0]*5,-1:1:10j] ?
Aug 27, 2019 in Python 851 views

## 1 answer to this question.

10j in b = np.r_[3,[0]*5,-1:1:10j] means that the step value is imaginary. So here, the slicing starts from -1, upto 1 and the step size is 10j (start:stop:stepj). The value of 10j here is:

((1-(-1)) / 9)= 2 / 9= 0.2222222...

So if you print b, you will see the output to be as follows:

```array([ 3.        ,  0.        ,  0.        ,  0.        ,  0.        ,
0.        , -1.        , -0.77777778, -0.55555556, -0.33333333,
-0.11111111,  0.11111111,  0.33333333,  0.55555556,  0.77777778,
1.        ])```
• 1,950 points

## What is the meaning of “int(a[::-1])” in Python?

Assumming a is a string. The Slice ...READ MORE

## Meaning of -> in Python

It's a function annotation. In more detail, Python 2.x ...READ MORE

## .What is the meaning of "while True :" while doing in a loop.

The body of the loop will continue ...READ MORE

## Use and meaning of "in" in an if statement?

In an example from Zed Shaw's Learn Python ...READ MORE

## What is the meaning of "int(a[::-1])" in Python? [duplicate]

I don't get this at all. In ...READ MORE

## what is the practical use of polymorphism in Python?

Polymorphism is the ability to present the ...READ MORE

## Use of "continue" in python

The break statement is used to "break" ...READ MORE

## Polynomials in Python

You can easily find polynomials of any ...READ MORE

+1 vote