Scientific computing and the SciPy module in Python

Scientific computing and the SciPy module in Python

Hello! Today I would like to tell you about scientific computing using the language Python and SciPy modules… In many scientific calculations in the field of mathematics or physics, it becomes necessary to find certain dependencies. For example: coordinates of the ball in time t for a given function, acceleration of a body, statistical values ​​from a sample, and so on… Of course, the calculation of such values ​​is provided in many languages, but still Python due to the clarity of the syntax, it allows you to find them without thinking about the complexity of the implementation. In addition, the language community is developing similar libraries that allow us to use ready-made constants and formulas. This feature is implemented in the library SciPy.

SciPy Is a scientific computing library that uses NumPy .

Abbreviation SciPy means Scientific Python.

Like NumPy, SciPy is open source so we can use it freely. Note that it is based on the library NumPy.

Why use SciPy?

If SciPy использует NumPy под капотом, почему мы не можем просто использовать NumPy?.

The fact is that SciPy содержит функции, которые часто используются в NumPy and Data Science.

На каком языке написан SciPy?

SciPy mostly written in Python, но некоторые сегменты написаны на C.

Where is the SciPy codebase located?

Source SciPy is in this scipy repository

Установка SciPy.

SciPy comes with the package Anaconda. Если же его нет, но установлены Python 3.8 и PIP в системе, то установка SciPy very simple. First, let’s create a virtual environment with venv for Python 3.6 и выше. И в терминале
we introduce:


# для Windows

>>> python3 -m venv My_Venv
>>> cd My_Venv/Scripts
>>> activate

# Мы должны увидеть следующее

(My_Venv)>>>

# Что обозначает активированную среду/папку

# перейдем к установке библиотеки
(My_Venv)>>>pip install scipy

Импорт констант SciPy.


from scipy import constants

'''
выведем список содержащихся в нем констант:

Avogadro
Boltzmann
Btu
Btu_IT
Btu_th
ConstantWarning
G
Julian_year
N_A
Planck
R
Rydberg
Stefan_Boltzmann
'''

# используя одну из констант, теперь вычислим сколько кубометров в одном литре

print(constants.liter)

# вывод

0.001

Thus using SciPy в научных вычислениях можно существенно сократить объем кода и сфокусироваться на решении самой задачи.

Previous article Next article

Copying of materials is allowed only with the indication of the author (Mikhail Rusakov) and an indexed direct link to the site (http://myrusakov.ru)!

Add to my friends VK: http://vk.com/myrusakov.
If you want to rate me and my work, then write it in my group: http://vk.com/rusakovmy.

If you do not want to miss new materials on the site,
then you can subscribe to updates: Subscribe to updates

If you still have any questions, or you have a desire to comment on this article, then you can leave your comment at the bottom of the page.

Recommend this article to your friends:

If you liked the site, then post a link to it (on your site, on the forum, in contact):

  1. Button:

    It looks like this: How to create your website

  2. Text link:

    It looks like this: How to create your website

  3. BB-code of the link for forums (for example, you can put it in the signature):

Related Posts

Property Management in Dubai: Effective Rental Strategies and Choosing a Management Company

“Property Management in Dubai: Effective Rental Strategies and Choosing a Management Company” In Dubai, one of the most dynamically developing regions in the world, the real estate…

In Poland, an 18-year-old Ukrainian ran away from the police and died in an accident, – media

The guy crashed into a roadside pole at high speed. In Poland, an 18-year-old Ukrainian ran away from the police and died in an accident / illustrative…

NATO saw no signs that the Russian Federation was planning an attack on one of the Alliance countries

Bauer recalled that according to Article 3 of the NATO treaty, every country must be able to defend itself. Rob Bauer commented on concerns that Russia is…

The Russian Federation has modernized the Kh-101 missile, doubling its warhead, analysts

The installation of an additional warhead in addition to the conventional high-explosive fragmentation one occurred due to a reduction in the size of the fuel tank. The…

Four people killed by storm in European holiday destinations

The deaths come amid warnings of high winds and rain thanks to Storm Nelson. Rescuers discovered bodies in two separate incidents / photo ua.depositphotos.com Four people, including…

Egg baba: a centuries-old recipe of 24 yolks for Catholic Easter

They like to put it in the Easter basket in Poland. However, many countries have their own variations of “bab”. The woman’s original recipe is associated with…

Leave a Reply

Your email address will not be published. Required fields are marked *