Meaning of 10j in SciPy

0 votes
What is the meaning of 10j in b = np.r_[3,[0]*5,-1:1:10j] ?
Aug 27, 2019 in Python by Fata
• 1,050 points
418 views

1 answer to this question.

0 votes

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.        ])
answered Aug 27, 2019 by Wajiha
• 1,950 points

Related Questions In Python

0 votes
1 answer

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

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

answered Aug 27, 2018 in Python by Priyaj
• 58,080 points
3,735 views
0 votes
1 answer

Meaning of -> in Python

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

answered Nov 12, 2018 in Python by Priyaj
• 58,080 points
179 views
0 votes
1 answer

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

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

answered Oct 7, 2020 in Python by Gitika
• 65,870 points
139 views
0 votes
0 answers

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

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

Apr 22 in Python by Edureka
• 10,240 points
23 views
+2 votes
3 answers

what is the practical use of polymorphism in Python?

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

answered Mar 31, 2018 in Python by anto.trigg4
• 3,440 points
3,167 views
+4 votes
6 answers

Use of "continue" in python

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

answered Jul 16, 2018 in Python by Omkar
• 69,190 points
508 views
+2 votes
2 answers

In a list of dictionaries, how can I find the minimum calue in a common dictionary field.

There are several options. Here is a ...READ MORE

answered Apr 10, 2018 in Python by charlie_brown
• 7,710 points
635 views
0 votes
1 answer

Polynomials in Python

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

answered Aug 27, 2019 in Python by Wajiha
• 1,950 points
387 views
+1 vote
1 answer

Creating a range of dates in Python

Yes, you can do it as follows: import ...READ MORE

answered Jul 4, 2019 in Python by Wajiha
• 1,950 points
895 views
0 votes
1 answer

flush parameter of print in Python

Usually all I/Os are buffered, meaning they ...READ MORE

answered Jul 30, 2019 in Python by Wajiha
• 1,950 points
3,121 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP