Skip to Content
Python金融实战
book

Python金融实战

by Posts & Telecom Press, Yuxing Yan
February 2024
Intermediate to advanced content levelIntermediate to advanced
347 pages
5h 19m
Chinese
Packt Publishing
Content preview from Python金融实战

第6章 NumPy和SciPy模块简介

本章将介绍两个广泛用于科学和金融计算的重要模块——NumPy和SciPy。本书用到的许多其他模块都依赖这两个模块。本章主要内容如下。

  • NumPySciPy模块的安装
  • 利用Anaconda启动Python
  • 使用NumPySciPy的示例
  • 显示NumPySciPy包含的所有函数
  • 获取某个函数的更多信息
  • 理解列表数据类型
  • NumPy里的矩阵以及矩阵的逻辑关系
  • 特殊矩阵:全一矩阵、全零矩阵和单位矩阵
  • 执行矩阵运算:+、−、*和/
  • x.sum()函数
  • 通过循环遍历一个数组
  • SciPy模块的子包列表
  • 累积标准正态分布
  • 随机数的生成
  • SciPy包含的统计子模块(stats
  • 插值、线性方程组和优化
  • 线性回归和资本资产定价模型(CAPM)
  • 从外部文本文件读取数据
  • 如何独立安装NumPy模块
  • 数据类型简介

第5章讨论了模块之间的依赖性并提到依赖性可能增加安装一个模块的难度。幸运的是,有些超级软件包,比如AnacondaEnthought Canoy,可以同时安装多个模块。这本书用到了Anaconda,因为它同时包含NumPySciPy这两个模块。执行以下两个步骤来安装它。

1.访问http://continuum.io/downloads

2.根据你的计算机,选择适当的软件下载,如图6-1所示。

Picture 2

图6-1

安装完成后将看到相关的目录,如c:\Users\yany\AppData\Local\Continuum\Anaconda3\。除了NumPy和SciPy外,Anaconda还安装了我们计划在这本书中讨论的其他3个模块。可以在 ...

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.
Start your free trial

You might also like

实时数据处理和分析指南

实时数据处理和分析指南

Posts & Telecom Press, Shilpi Saxena, Saurabh Gupta
数据科学实战手册(R+Python)(第2版)

数据科学实战手册(R+Python)(第2版)

Posts & Telecom Press, Prabhanjan Narayanachar Tattar, Tony Ojeda, Sean Patrick Murphy, Sean P Murphy, Benjamin Bengfort, Bengfort Benjamin, ABHIJIT DASGUPTA
Python应用开发指南

Python应用开发指南

Posts & Telecom Press, Ninad Sathaye
编写整洁的Python代码(第2版)

编写整洁的Python代码(第2版)

Posts & Telecom Press, Mariano Anaya

Publisher Resources

ISBN: 9781803230375