Skip to Content
Python算法交易
book

Python算法交易

by Yves Hilpisch
November 2022
Intermediate to advanced
392 pages
10h 8m
Chinese
China Electric Power Press Ltd.
Content preview from Python算法交易
336
|
附录
有关应用于金融的
Python
的全面概述,请参阅
Hilpisch
(
2018
)。其他更一般的介绍,
主讲科学和数据分析语言
VanderPlas
(
2017
)和
McKinney
(
2017
)。
Python
基础
本节介绍基本的
Python
数据类型和结构、控制结构和一些
Python
习语。
数据类型
值得注意的是,
Python
通常是一个动态类型系统,这意味着对象的类型是从它们的
上下文中推断出来的。让我们从数字开始。
In [1]: a = 3
In [2]: type(a)
Out[2]: int
In [3]: a.bit_length()
Out[3]: 2
In [4]: b = 5.
In [5]: type(b)
Out[5]: float
为变量名分配一个整数值
3
。
查看
a
的类型。
查看用于存储整数值的位数。
给变量名
b
赋一个浮点值
5.0
例如,
Python
可以处理任意大的整数,这对数论应用非常有益。
In [6]: c = 10 ** 100
In [7]: c
Out[7]:
100000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000
Python
、
NumPy
、
matplotlib
和
pandas
|
337
In [8]: c.bit_length()
Out[8]: 333
分配一个“巨大”的整数值。
显示用于整数表示的位数。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
图解大模型 : 生成式AI 原理与实战

图解大模型 : 生成式AI 原理与实战

Jay Alammar, Maarten Grootendorst

Publisher Resources

ISBN: 9787519869694