Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Q1
- import numpy as np
- def findk(temp,comp):
- if 0 <= comp <= 5:
- if 258 <= temp < 774:
- k = (0.48934 * temp) - (0.48934*258) + 505
- elif 774 < temp <= 1290:
- k = (-0.48934 * temp) - (-0.48934 * 774) + 757.5
- elif temp == 774:
- k = 757.5
- elif 258 > temp or temp > 1290:
- return np.nan
- elif 5 < comp <= 10:
- if 258 <= temp < 774:
- k = (-0.48934 * temp) - (-0.48934 * 258) + 757.5
- elif 774 < temp <= 1290:
- k = (0.48934 * temp) - (0.48934 * 774) + 505
- elif temp == 774:
- k = 505
- elif 258 > temp or temp > 1290:
- return np.nan
- return k
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement