Python Programming for Biology: Bioinformatics and Beyond



Download 7,75 Mb.
Pdf ko'rish
bet477/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   473   474   475   476   477   478   479   480   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

Module

Description

Example


fft

A module with methods to perform Fourier

analysis, such as the discrete Fourier

transform and its inverse.

from numpy import

exp, pi, arange

I = complex(0, 1)

t = arange(0.0, 5.0,

0.1)

decay = 0.3



x = exp(2*pi*I*t) *

exp(-decay*t)

w = fft.fft(x)

z = fft.ifft(w)

# z = x up to

numerical error

linalg

A module with methods to perform array



operations common in linear (matrix)

algebra, for example, to calculate

determinant, eigenvalues, eigenvectors,

inverse, single value decomposition etc.

m1 = array([[-1, 1],

[ 2, 3]])

linalg.eig(m1)

linalg.det(m1)

linalg.inv(m1)

linalg.svd(m1)

random

A module with methods for generating and



sampling (pseudo-)random numbers.

vals = random.rand(6)

# Six floats from 0.0

to 1.0


vals =

random.randint(2,9,5)

# Five ints in range

2 to 5


x = [1,2,3,4]

random.shuffle(x)

# New order

random.seed()

# Init pseudorandom

generator




Appendix 4

String formatting

Old-style formatting

The following table describes old-style string formatting codes, which are used in Python

strings  which  are  followed  by  the  ‘%’  format  operator,  such  as  ‘%8.3f’  %  value.  These

follow the general system used by sprintf/printf in the standard C library. The general form

of the formatting code syntax is:

'%
<.numDigits>>' % data

where data is either a single value or a tuple of values. This formatting system is described

at the end of

Chapter 3

.


Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   473   474   475   476   477   478   479   480   ...   514




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish