The difference between linspace () and Arange () in Python

Source: Internet
Author: User
The difference between linspace () and Arange () in Python

Today, I accidentally see an linspace(0,4,5) array that can produce one, and I  don't know what the parameters array([0,1,2,3,4]) are, so I have this blog post.

Linspace ()

Linspace () creates a one-dimensional array that represents the arithmetic progression by specifying a start value, a final value, and the number of elements, which can be specified by the endpoint parameter to include a final value, and the default value is True, which contains the final value. See the example below

Arange ()

Arange () creates a one-dimensional array that represents arithmetic progression by specifying a start value, a final value (without a final value), and a step size, noting that the resulting array does not contain a final value.
See the example below

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The difference between linspace () and Arange () in Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.