We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# -*- coding: utf-8 -*- """ Created on Tue Jan 31 18:05:11 2023 @author: seungj.jung """ import os import pandas as pd import pickle unitconv_length = pd.read_pickle('Unitconv_length.p') unitconv_area = pd.read_pickle('Unitconv_area.p') unitconv_volume = pd.read_pickle('Unitconv_volume.p') unitconv_pressure = pd.read_pickle('Unitconv_pressure.p') class unitconv: def __init__(self,selection, fromunit, tounit, value): self.type = selection # length, area, volume self.funit = fromunit # 기존 단위 self.tunit = tounit # 변경하고자 하는 단위 self.value = value # 값 def cal(self): if self.type == "length": factor = unitconv_length.loc[self.funit, self.tunit] sol = factor * self.value elif self.type =="area": factor = unitconv_area.loc[self.funit, self.tunit] sol = factor * self.value elif self.type =="volume": factor = unitconv_volume.loc[self.funit, self.tunit] sol = factor * self.value elif self.type =="pressure": factor = unitconv_pressure.loc[self.funit, self.tunit] sol = factor * self.value return sol ## a = unitconv("length","mm", "ft", 50) ## b = a.cal() ## a = unitconv("length","mm", "ft", 50).cal()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: