本文簡要介紹 python 語言中 scipy.constants.convert_temperature
的用法。
用法:
scipy.constants.convert_temperature(val, old_scale, new_scale)#
從一個溫度尺度轉換為攝氏、開爾文、華氏和蘭金尺度之間的另一個溫度尺度。
- val: array_like
以原始刻度表示的要轉換的溫度值。
- old_scale: str
將轉換溫度值的原始比例指定為字符串。支持的刻度是攝氏度('Celsius'、‘celsius’、'C' 或 ‘c’)、開爾文('Kelvin'、‘kelvin’、'K'、‘k’)、華氏度('Fahrenheit'、‘fahrenheit’ , 'F' 或 ‘f’) 和 Rankine ('Rankine', ‘rankine’, 'R', ‘r’)。
- new_scale: str
將溫度值轉換到的新刻度指定為字符串。支持的刻度是攝氏度('Celsius'、‘celsius’、'C' 或 ‘c’)、開爾文('Kelvin'、‘kelvin’、'K'、‘k’)、華氏度('Fahrenheit'、‘fahrenheit’ , 'F' 或 ‘f’) 和 Rankine ('Rankine', ‘rankine’, 'R', ‘r’)。
- res: 浮點數或浮點數數組
以新刻度表示的轉換溫度值。
參數 ::
返回 ::
注意:
例子:
>>> from scipy.constants import convert_temperature >>> import numpy as np >>> convert_temperature(np.array([-40, 40]), 'Celsius', 'Kelvin') array([ 233.15, 313.15])
相關用法
- Python SciPy constants.nu2lambda用法及代碼示例
- Python SciPy constants.precision用法及代碼示例
- Python SciPy constants.unit用法及代碼示例
- Python SciPy constants.find用法及代碼示例
- Python SciPy constants.value用法及代碼示例
- Python SciPy constants.lambda2nu用法及代碼示例
- Python SciPy contingency.relative_risk用法及代碼示例
- Python SciPy contingency.crosstab用法及代碼示例
- Python SciPy contingency.margins用法及代碼示例
- Python SciPy contingency.chi2_contingency用法及代碼示例
- Python SciPy contingency.odds_ratio用法及代碼示例
- Python SciPy contingency.expected_freq用法及代碼示例
- Python SciPy convolve.init_convolution_kernel用法及代碼示例
- Python SciPy contingency.association用法及代碼示例
- Python SciPy coo_array.tocsr用法及代碼示例
- Python SciPy coo_matrix.tocsr用法及代碼示例
- Python SciPy coo_matrix.tocsc用法及代碼示例
- Python SciPy coo_array.diagonal用法及代碼示例
- Python SciPy coo_array.dot用法及代碼示例
- Python SciPy coo_array.tocsc用法及代碼示例
- Python SciPy coo_matrix.nonzero用法及代碼示例
- Python SciPy coo_matrix.dot用法及代碼示例
- Python SciPy coo_matrix.diagonal用法及代碼示例
- Python SciPy coo_array.nonzero用法及代碼示例
- Python SciPy csc_array.diagonal用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.constants.convert_temperature。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。