下記のコードを書いて出力したのですが
Decimalの桁数を6ケタにしているつもりなのですが
出力は28ケタで出てくるのですが,
なにか間違えていますか?
import pandas as pd import decimal as dec reference1 = pd.read_csv('probedata_dome_prs_rp1', delim_whitespace=True, comment='#',names=['A', 'B', 'C']) reference2 = pd.read_csv('probedata_dome_prs_rp2', delim_whitespace=True, comment='#',names=['A', 'B', 'C']) reference3 = pd.read_csv('probedata_dome_prs_rp3', delim_whitespace=True, comment='#',names=['A', 'B', 'C']) ref1 = reference1['C'] ref2 = reference2['C'] ref3 = reference3['C'] print(ref1) print(ref2) print(ref3) dec.getcontext().prec = 6 print(dec.Decimal(ref1[1])) print(dec.Decimal(ref2[1])) print(dec.Decimal(ref3[1]))
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。