简单地说,魔术函数%precision不考虑输出简单变量的浮点精度。
#Configure matplotlib to run on the browser
%matplotlib notebook
%precision 3
from ipywidgets import widgets
from IPython.display import display
import pandas as pd
import numpy as np
import matplotlib as mpl
mpl.get_backend() #Import pyplot scripting layer as plt
import matplotlib.pyplot as plt
import ipywidgets as widgets
np.random.seed(12345)
np.set_printoptions(precision=3)
df = pd.DataFrame([np.random.normal(32000,200000,3650),
np.random.normal(43000,100000,3650),
np.random.normal(43500,140000,3650),
np.random.normal(48000,70000,3650)],
index=[1992,1993,1994,1995]).T
df_stats = df.describe()
a=8/11
输出只是0
请协助。
答案 0 :(得分:0)