Python numpy function: Logspace () Create geometric progression array

Source: Internet
Author: User
Tags arithmetic

The previous article introduces the Linspace function creation arithmetic progression                                                              &NB Sp                                   &NB Sp                                   &NB Sp                                   &NB Sp                                   &NB Sp                           This explains how to use logspace to create geometric progression:

The creation of geometric progression and arithmetic progression is similar, with only one place to note:

The starting and terminating bits of the above examples are all 0, the number of elements is 10, but the generated geometric progression is all 1, because in Logspace, the starting and terminating bits represent the power of 10 (the default cardinality is 10), 0 for 10, 0 for 9, and the following:

If you want to change the cardinality, you need to modify its default cardinality, enter a fourth parameter base, and change its value:

If you do not want to include the tail node, you can add a parameter endpoint, the default setting is 1, and when necessary, the base is adjusted appropriately to accommodate the number of changes


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.