1、SciPy常数

由于SciPy更加专注于科学实现,因此它提供了许多内置的科学常数。

当您使用数据科学时,这些常量可能会有所帮助。

PI是科学常数的一个例子。

例如:

打印PI的常数值:from scipy import constants

print(constants.pi)

2、常量

使用dir()函数可以看到常量模块下所有单位的列表。

例如:

列出所有常量:from scipy import constants

print(dir(constants))

3、单位类别

单位位于以下类别中:Metric

Binary

Mass

Angle

Time

Length

Pressure

Volume

Speed

Temperature

Energy

Power

Force

4、公制前缀:

以meter返回指定的单位(例如centi返回0.01)

例如:from scipy import constants

print(constants.yotta) #1e+24

print(constants.zetta) #1e+21

print(constants.exa) #1e+18

print(constants.peta) #1000000000000000.0

print(constants.tera) #1000000000000.0

print(constants.giga) #1000000000.0

print(constants.mega) #1000000.0

print(constants.kilo) #1000.0

print(constants.hecto) #100.0

print(constants.deka) #10.0

print(constants.deci) #0.1

print(constants.centi) #0.01

print(constants.milli) #0.001

print(constants.micro) #1e-06

print(constants.nano) #1e-09

print(constants.pico) #1e-12

print(constants.femto) #1e-15

print(constants.atto) #1e-18

print(constants.zepto) #1e-21

5、二进制前缀:

以bytes返回指定的单位(例如kibi返回1024)

例如:from scipy import constants

print(constants.kibi) #1024

print(constants.mebi) #1048576

print(constants.gibi) #1073741824

print(constants.tebi) #1099511627776

print(constants.pebi) #1125899906842624

print(constants.exbi) #1152921504606846976

print(constants.zebi) #1180591620717411303424

print(constants.yobi) #1208925819614629174706176

6、质量:

以kg返回指定的单位(例如gram返回0.001)

例如:from scipy import constants

print(constants.gram) #0.001

print(constants.metric_ton) #1000.0

print(constants.grain) #6.479891e-05

print(constants.lb) #0.45359236999999997

print(constants.pound) #0.45359236999999997

print(constants.oz) #0.028349523124999998

print(constants.ounce) #0.028349523124999998

print(constants.stone) #6.3502931799999995

print(constants.long_ton) #1016.0469088

print(constants.short_ton) #907.1847399999999

print(constants.troy_ounce) #0.031103476799999998

print(constants.troy_pound) #0.37324172159999996

print(constants.carat) #0.0002

print(constants.atomic_mass) #1.66053904e-27

print(constants.m_u) #1.66053904e-27

print(constants.u) #1.66053904e-27

7、角度(Angle):

以弧度返回指定的单位(例如,degree返回0.017453292519943295)

例如:from scipy import constants

print(constants.degree) #0.017453292519943295

print(constants.arcmin) #0.0002908882086657216

print(constants.arcminute) #0.0002908882086657216

print(constants.arcsec) #4.84813681109536e-06

print(constants.arcsecond) #4.84813681109536e-06

8、时间(Time):

在seconds中返回指定的单位(例如hour返回3600.0)

例如:from scipy import constants

print(constants.minute) #60.0

print(constants.hour) #3600.0

print(constants.day) #86400.0

print(constants.week) #604800.0

print(constants.year) #31536000.0

print(constants.Julian_year) #31557600.0

9、长度

以meters返回指定的单位(例如nautical_mile返回1852.0)

例如:from scipy import constants

print(constants.inch) #0.0254

print(constants.foot) #0.30479999999999996

print(constants.yard) #0.9143999999999999

print(constants.mile) #1609.3439999999998

print(constants.mil) #2.5399999999999997e-05

print(constants.pt) #0.00035277777777777776

print(constants.point) #0.00035277777777777776

print(constants.survey_foot) #0.3048006096012192

print(constants.survey_mile) #1609.3472186944373

print(constants.nautical_mile) #1852.0

print(constants.fermi) #1e-15

print(constants.angstrom) #1e-10

print(constants.micron) #1e-06

print(constants.au) #149597870691.0

print(constants.astronomical_unit) #149597870691.0

print(constants.light_year) #9460730472580800.0

print(constants.parsec) #3.0856775813057292e+16

10、压强:

以pascals返回指定的单位(例如psi返回6894.757293168361)

例如:from scipy import constants

print(constants.atm) #101325.0

print(constants.atmosphere) #101325.0

print(constants.bar) #100000.0

print(constants.torr) #133.32236842105263

print(constants.mmHg) #133.32236842105263

print(constants.psi) #6894.757293168361

11、面积:

返回以平方米(square meters)为单位的指定单位(例如,hectare返回10000.0)

例如:from scipy import constants

print(constants.hectare) #10000.0

print(constants.acre) #4046.8564223999992

12、容积:

以立方米(cubic meters)返回指定单位(例如,liter返回0.001)

例如:from scipy import constants

print(constants.liter) #0.001

print(constants.litre) #0.001

print(constants.gallon) #0.0037854117839999997

print(constants.gallon_US) #0.0037854117839999997

print(constants.gallon_imp) #0.00454609

print(constants.fluid_ounce) #2.9573529562499998e-05

print(constants.fluid_ounce_US) #2.9573529562499998e-05

print(constants.fluid_ounce_imp) #2.84130625e-05

print(constants.barrel) #0.15898729492799998

print(constants.bbl) #0.15898729492799998

13、速度:

返回以米/秒为单位的指定单位(例如speed_of_sound返回340.5)

例如:from scipy import constants

print(constants.kmh) #0.2777777777777778

print(constants.mph) #0.44703999999999994

print(constants.mach) #340.5

print(constants.speed_of_sound) #340.5

print(constants.knot) #0.5144444444444445

14、温度:

以开尔文(Kelvin)返回指定的单位(例如zero_Celsius返回273.15)

例如:from scipy import constants

print(constants.zero_Celsius) #273.15

print(constants.degree_Fahrenheit) #0.5555555555555556

15、能量:

以焦耳返回指定的单位(例如calorie返回4.184)

例如:from scipy import constants

print(constants.eV) #1.6021766208e-19

print(constants.electron_volt) #1.6021766208e-19

print(constants.calorie) #4.184

print(constants.calorie_th) #4.184

print(constants.calorie_IT) #4.1868

print(constants.erg) #1e-07

print(constants.Btu) #1055.05585262

print(constants.Btu_IT) #1055.05585262

print(constants.Btu_th) #1054.3502644888888

print(constants.ton_TNT) #4184000000.0

16、功率:

返回以瓦特(watts)为单位的指定单位(例如,horsepower返回745.6998715822701)

例如:from scipy import constants

print(constants.hp) #745.6998715822701

print(constants.horsepower) #745.6998715822701

17、力量:

以newton返回指定单位(例如,kilogram_force返回9.80665)

例如:from scipy import constants

print(constants.dyn) #1e-05

print(constants.dyne) #1e-05

print(constants.lbf) #4.4482216152605

print(constants.pound_force) #4.4482216152605

print(constants.kgf) #9.80665

print(constants.kilogram_force) #9.80665

python中arcsec_Python SciPy 常数(Constants)相关推荐

  1. python中的scipy基础知识_python中SciPy是什么?

    python中Numpy常用于计算二维数组计算,而python的另一个库SciPy库与Numpy有着密切的关系,是需要通过Numpy为基础,同时也是通过Numpy数据来操控科学计算.常见的是插值运算. ...

  2. python中使用scipy.integrate求积分、二重积分、三重积分

    python中使用scipy.integrate求积分.二重积分.三重积分 代码如下: import numpy as np from scipy.integrate import quad, tpl ...

  3. python 中的 scipy.optimize 最优化功能的一些不足

    python 中的 scipy 也有最优化的功能,体现在里面的 optimize 中,自己简单使用了下,发现它具有以下缺点: 优化算法比较少,有信頼域.单纯形法.BFGS算法等,能够满足不少常规函数的 ...

  4. 四十二、MOOC课程 | Python中的Scipy模块

    这是MOOC课上的Scipy基础 SciPy的介绍 在Numpy库的基础上增加了众多的数学.科学以及工程计算中常用 的库函数 例如: 线性代数 常微分方程数值求解 信号处理 图像处理 稀疏矩阵 Sci ...

  5. python中的scipy基础知识_Python机器学习(五十二)SciPy 基础功能

    默认情况下,所有NumPy函数都可以在SciPy(命名空间)中使用.当导入SciPy时,不需要显式地导入NumPy函数.NumPy的主要对象是n次多维数组ndarray,SciPy构建在ndarray ...

  6. python中quad_python scipy integrate.quad用法及代码示例

    计算定积分. 使用Fortran库QUADPACK中的技术将func从a集成到b(可能是无限间隔). 参数: func:{function, scipy.LowLevelCallable}集成的Pyt ...

  7. python中arcsec_python绘制基本初等函数图像

    之前用python绘制了笛卡尔直角坐标系,绘制了指数函数,绘制了对数函数,有了这三个基础工作的积累,本期,将研究如何利用python把六类基本初等函数一劳永逸的绘制出来. 基本初等函数概念 简单的说基 ...

  8. python中的scipy基础知识_python3 scipy 入门

    正态分布: ''' Scipy中的stats模块包含了多种常用的数据统计函数,包括连续和离散两种随机变量. 对于连续随机变量,可有如下操作: rvs:随机变量进行取值,通过size给定大小 pdf:概 ...

  9. python中使用scipy.optimize.leastsq进行球面、圆柱面、平面拟合

    scipy.optimize.leastsq官方文档 之前自己用最小二乘进行过球面.柱面和平面拟合,球面和平面效果都很好,但是柱面效果一直不好(对初值十分敏感,迭代过程中经常出现奇异矩阵,也有可能是自 ...

最新文章

  1. 用Gson实现json与对象、list集合之间的相互转化
  2. java 如何循环执行一个对象_Java基础:如何定义好一个方法和进行方法重载
  3. 大学大专mysql考试试卷_MySQL数据库基础应用-中国大学mooc-试题题目及答案
  4. iPhone 12不标配充电器后,国产手机配件成了国外抢手货!
  5. 远程桌面管理工具Remote Desktop Connection Manager 2.2
  6. 鲁棒控制(Ⅰ)—LMI处理方法
  7. Photoshop CS5无法卸载或卸载不干净怎么办?
  8. windows清理_一个Windows系统下好用的内存清理工具
  9. 用LSTM自动生成古诗
  10. PMI权限(授权)管理基础设施
  11. ptb同一屏呈现两张图片matlab,Psychtoolbox-3 / PTB-3 for Matlab 入门
  12. 华为云主机安全防护的新发现
  13. iOS上传AppStore所需各种图片尺寸
  14. 去中心化市场OpenBazaar如何运转
  15. 2020年chx的计算机保研之路系列(3)——中科院计算所(获得offer)
  16. Java面向对象学习练习———潜艇游戏(飞机游戏)
  17. 《Internet 路由结构(第2版•修订版)》一7.6 参考资料
  18. ubuntu18.04交叉编译移植OpenCV4.70和QT5.12.12至ARM64位平台LKD3588(开发板为ubuntu22.04系统)(三)
  19. Angular2+简单入门
  20. C#“同步调用”、“异步调用”、“异步回调”

热门文章

  1. Beam failure Recovery
  2. Xen vtpm安装随笔
  3. 香港在线下和线上以科技呈献缤纷耀眼的圣诞
  4. ICRA2021 MOT GSDT论文解读
  5. 戴尔 服务器重装后蓝屏,dell inspiron 5490重新安装win10 1903专业工作站版系统后开机频繁蓝屏...
  6. idea新建的springBoot项目,自动生成的入口类中提示错误Cannot resolve symbol ‘@springbootapplication‘
  7. 5-6 人生的不同阶段
  8. 微信小程序常用知识点总结
  9. 【云服务架构】大健康之互联网医疗解决方案
  10. 笔记本开机数字小键盘自动打开问题