window.setinterval,t如何添加timer控件?
1、 启动动VB,在新建工程对话框中选用“ActiveX控件”选项。

2、 VB自动建一个用户控件设计器(UserControl)窗口,并命名为“UserControl”。
3、 单击工具箱的Label控件(用它显示时间),
4、 双击工具箱中的“Timer”控件。
5、 控件属性调整:按PPT文件的背景色在调好窗体及Label的背景色。在Timer1控件中,将Enabled设为True,将Interval设为1000(单位为ms,)以每秒触发一次。
6、 代码:取得系统时间并设置时间的格式,AM.PM分别上下午。
7、 在“工程”菜单中,选择“工程1属性”,在弹出的对话框中8、 工程类型中写入“ActiveX”控件,以编译成”.OCX”为后缀名的ActiveX控件9、 工程名任定(如取名为timer)10、 在文件菜单中,单击“生成工程1.ocx”项,生成ActiveX控件,将其存于”Windows\system”或“winnt\system32”文件夹中。11、 在PPT中选控件插入自己建好的ActiveX控件,如Timer,在PPT的母版中画出一个合适大小的图标,之后将它放在页脚等地方。保存即可。
可视化编程软件有哪些好的推荐?
python了解一下
全文超过6W子,只能贴出部分,全文可私信小编获取
目录准备工作一、关联(Correlation)关系图1、散点图(Scatter plot)2、边界气泡图(Bubble plot with Encircling)3、散点图添加趋势线(Scatter plot with linear regression line of best fit)4、分面散点图添加趋势线(Each regression line in its own column)5、抖动图(Jittering with stripplot)6、计数图(Counts Plot)7、边缘直方图(Marginal Histogram)8、边缘箱图(Marginal Boxplot)9、相关性热图(Correllogram)10、矩阵图 (Pairwise Plot)二、偏差 (Deviation)关系图11、发散型柱形图 (Diverging Bars)12、发散型文本图(Diverging Texts)-水平方向13、发散型文本图(Diverging Texts)-垂直方向14、发散型点图(Diverging Dot Plot)15、带Marker的发散型棒棒糖图 (Diverging Lollipop Chart with Markers)16、面积图(Area Chart)三、排序 (Ranking)关系图17、排序柱形图(Ordered Bar Chart)18、棒棒糖图(Lollipop Chart)19、点图 (Dot Plot)20、坡图(Slope Chart)21、哑铃图(Dumbbell Plot)四、分布(Distribution)关系图21、连续变量堆积直方图(Stacked Histogram for Continuous Variable)22、类别变量堆积直方图(Stacked Histogram for Categorical Variable)23、密度图(Density Plot)24、带直方图的密度图(Density Curves with Histogram)25、山峰叠峦图(Joy Plot)26、分布点图(Distributed Dot Plot)27、箱图(boxplot)28、箱图结合点图(Dot + Box Plot)29、小提琴图(Violin Plot)30、金字塔图(Population Pyramid)31、分类图(Categorical Plots)五、组成(Composition)关系图32、华夫饼图(Waffle Chart)33、饼图(Pie Chart)34、树状图(Treemap)35、柱状图(Bar Chart)六、变化(Change)关系图36、时间序列图(Time Series Plot)37、波峰和波谷添加注释的时间序列图(Time Series with Peaks and Troughs Annotated)38、自相关和部分自相关图(Autocorrelation (ACF) and Partial Autocorrelation (PACF) Plot)39、交叉相关图(Cross Correlation plot)40、时间序列分解图(Time Series Decomposition Plot)41、多重时间序列图(Multiple Time Series)42、双坐标系时间序列图(Plotting with different scales using secondary Y axis)43、带误差阴影的时间序列图(Time Series with Error Bands)44、堆积面积图(Stacked Area Chart)45、非堆积面积图(Area Chart UnStacked)46、日历热力图(Calendar Heat Map)47、季节图(Seasonal Plot)七、分组( Groups)关系图48、聚类树形图(Dendrogram)49、聚类图(Cluster Plot)50、安德鲁斯曲线(Andrews Curve)51、平行坐标图(Parallel Coordinates)
准备工作主要是导入绘图模块,设置绘图风格。
import numpy as npimport pandas as pdimport matplotlib as mplimport matplotlib.pyplot as pltimport seaborn as snsimport warningswarnings.filterwarnings(action='once')plt.style.use('seaborn-whitegrid')sns.set_style("whitegrid")print(mpl.__version__)print(sns.__version__)
34、树状图(Treemap)类似饼图的效果,面积大小反应变量大小。
!pip install squarify#安装依赖包import squarify# Import Datadf_raw = pd.read_csv("./datasets/mpg_ggplot2.csv")# Prepare Datadf = df_raw.groupby('class').size().reset_index(name='counts')labels = df.apply(lambda x: str(x[0]) + "\n (" + str(x[1]) + ")", axis=1)sizes = df['counts'].values.tolist()colors = [plt.cm.Set2(i / float(len(labels))) for i in range(len(labels))]# Draw Plotplt.figure(figsize=(10, 8), dpi=100)squarify.plot(sizes=sizes, label=labels, color=colors, alpha=.8)# Decorateplt.title('Treemap of Vechile Class')plt.axis('off')plt.show()
35、柱状图(Bar Chart)柱子高度表示变量大小。
import random# Import Datadf_raw = pd.read_csv("./datasets/mpg_ggplot2.csv")# Prepare Datadf = df_raw.groupby('manufacturer').size().reset_index(name='counts')n = df['manufacturer'].unique().__len__() + 1all_colors = list(plt.cm.colors.cnames.keys())random.seed(100)c = random.choices(all_colors, k=n)# Plot Barsplt.figure(figsize=(12, 8), dpi=80)plt.bar(df['manufacturer'], df['counts'], color=c, width=.5)for i, val in enumerate(df['counts'].values):plt.text(i,val,float(val),horizontalalignment='center',verticalalignment='bottom',fontdict={'fontweight': 500,'size': 12})# Decorationplt.gca().set_xticklabels(df['manufacturer'],rotation=60,horizontalalignment='right')plt.title("Number of Vehicles by Manaufacturers", fontsize=18)plt.ylabel('# Vehicles')plt.ylim(0, 45)plt.show()
更多关于柱状图:
「Python可视化|matplotlib12-垂直|水平|堆积条形图详解」六、变化(Change)关系图36、时间序列图(Time Series Plot)¶该图展示给定指标随时间的变化趋势。
# Import Datadf = pd.read_csv('./datasets/AirPassengers.csv')# Draw Plotplt.figure(figsize=(12, 8), dpi=80)plt.plot(df['date'], df['value'], color='#dc2624')# Decorationplt.ylim(50, 750)xtick_location = df.index.tolist()[::12]xtick_labels = [x[-4:] for x in df.date.tolist()[::12]]plt.xticks(ticks=xtick_location,labels=xtick_labels,rotation=0,fontsize=12,horizontalalignment='center',alpha=.7)plt.yticks(fontsize=12, alpha=.7)plt.title("Air Passengers Traffic (1949 - 1969)", fontsize=18)plt.grid(axis='both', alpha=.3)# Remove bordersplt.gca().spines["top"].set_alpha(0.0)plt.gca().spines["bottom"].set_alpha(0.3)plt.gca().spines["right"].set_alpha(0.0)plt.gca().spines["left"].set_alpha(0.3)plt.show()
37、波峰和波谷添加注释的时间序列图(Time Series with Peaks and Troughs Annotated)# Import Datadf = pd.read_csv('./datasets/AirPassengers.csv')# Get the Peaks and Troughsdata = df['value'].valuesdoublediff = np.diff(np.sign(np.diff(data)))peak_locations = np.where(doublediff == -2)[0] + 1doublediff2 = np.diff(np.sign(np.diff(-1 * data)))trough_locations = np.where(doublediff2 == -2)[0] + 1# Draw Plotplt.figure(figsize=(12, 8), dpi=80)plt.plot('date', 'value', data=df, color='tab:blue', label='Air Traffic')plt.scatter(df.date[peak_locations],df.value[peak_locations],marker=mpl.markers.CARETUPBASE,color='tab:green',s=100,label='Peaks')plt.scatter(df.date[trough_locations],df.value[trough_locations],marker=mpl.markers.CARETDOWNBASE,color='tab:red',s=100,label='Troughs')# Annotatefor t, p in zip(trough_locations[1::5], peak_locations[::3]):plt.text(df.date[p],df.value[p] + 15,df.date[p],horizontalalignment='center',color='darkgreen')plt.text(df.date[t],df.value[t] - 35,df.date[t],horizontalalignment='center',color='darkred')# Decorationplt.ylim(50, 750)xtick_location = df.index.tolist()[::6]xtick_labels = df.date.tolist()[::6]plt.xticks(ticks=xtick_location,labels=xtick_labels,rotation=45,fontsize=12,alpha=.7)plt.title("Peak and Troughs of Air Passengers Traffic (1949 - 1969)",fontsize=18)plt.yticks(fontsize=12, alpha=.7)# Lighten bordersplt.gca().spines["top"].set_alpha(.0)plt.gca().spines["bottom"].set_alpha(.3)plt.gca().spines["right"].set_alpha(.0)plt.gca().spines["left"].set_alpha(.3)plt.legend(loc='upper left')plt.grid(axis='y', alpha=.3)plt.show()
38、自相关和部分自相关图(Autocorrelation (ACF) and Partial Autocorrelation (PACF) Plot)自相关,展示时间序列与其自身滞后的相关性。部分自相关,展示任何给定滞后相对于当前序列的自相关。
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf# Import Datadf = pd.read_csv('./datasets/AirPassengers.csv')# Draw Plotfig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 6), dpi=80)plot_acf(df.value.tolist(), ax=ax1, lags=50)plot_pacf(df.value.tolist(), ax=ax2, lags=20)# Decorate# lighten the bordersax1.spines["top"].set_alpha(.3)ax2.spines["top"].set_alpha(.3)ax1.spines["bottom"].set_alpha(.3)ax2.spines["bottom"].set_alpha(.3)ax1.spines["right"].set_alpha(.3)ax2.spines["right"].set_alpha(.3)ax1.spines["left"].set_alpha(.3)ax2.spines["left"].set_alpha(.3)# font size of tick labelsax1.tick_params(axis='both', labelsize=12)ax2.tick_params(axis='both', labelsize=12)plt.show()
39、交叉相关图(Cross Correlation plot)展示两个时间序列相互之间的滞后。
import statsmodels.tsa.stattools as stattools# Import Datadf = pd.read_csv('./datasets/mortality.csv')x = df['mdeaths']y = df['fdeaths']# Compute Cross Correlationsccs = stattools.ccf(x, y)[:100]nlags = len(ccs)# Compute the Significance level# ref: https://stats.stackexchange.com/questions/3115/cross-correlation-significance-in-r/3128#3128conf_level = 2 / np.sqrt(nlags)# Draw Plotplt.figure(figsize=(12, 7), dpi=80)plt.hlines(0, xmin=0, xmax=100, color='gray') # 0 axisplt.hlines(conf_level, xmin=0, xmax=100, color='gray')plt.hlines(-conf_level, xmin=0, xmax=100, color='gray')plt.bar(x=np.arange(len(ccs)), height=ccs, width=.3)# Decorationplt.title('$Cross\; Correlation\; Plot:\; mdeaths\; vs\; fdeaths,fontsize=18)plt.xlim(0, len(ccs))plt.show()
40、时间序列分解图(Time Series Decomposition Plot)¶该图将时间序列分解为趋势、季节和残差分量(trend, seasonal and residual components.)。
from statsmodels.tsa.seasonal import seasonal_decomposefrom dateutil.parser import parse# Import Datadf = pd.read_csv('./datasets/AirPassengers.csv')dates = pd.DatetimeIndex([parse(d).strftime('%Y-%m-01') for d in df['date']])df.set_index(dates, inplace=True)# Decomposeresult = seasonal_decompose(df['value'], model='multiplicative')# Plotplt.figure(figsize=(12, 7), dpi=80)#plt.rcParams.update({'figure.figsize': (10, 10)})result.plot().suptitle('Time Series Decomposition of Air Passengers')plt.show()
41、多重时间序列图(Multiple Time Series)# Import Datadf = pd.read_csv('./datasets/mortality.csv')# Define the upper limit, lower limit, interval of Y axis and colorsy_LL = 100y_UL = int(df.iloc[:, 1:].max().max() * 1.1)y_interval = 400mycolors = ['tab:red', 'tab:blue', 'tab:green', 'tab:orange']# Draw Plot and Annotatefig, ax = plt.subplots(1, 1, figsize=(10, 6), dpi=80)columns = df.columns[1:]for i, column in enumerate(columns):plt.plot(df.date.values, df[column].values, lw=1.5, color=mycolors[i])plt.text(df.shape[0] + 1,df[column].values[-1],column,fontsize=14,color=mycolors[i])# Draw Tick linesfor y in range(y_LL, y_UL, y_interval):plt.hlines(y,xmin=0,xmax=71,colors='black',alpha=0.3,linestyles="--",lw=0.5)# Decorationsplt.tick_params(axis="both",which="both",bottom=False,top=False,labelbottom=True,left=False,right=False,labelleft=True)# Lighten bordersplt.gca().spines["top"].set_alpha(.3)plt.gca().spines["bottom"].set_alpha(.3)plt.gca().spines["right"].set_alpha(.3)plt.gca().spines["left"].set_alpha(.3)plt.title('Number of Deaths from Lung Diseases in the UK (1974-1979)',fontsize=18)plt.yticks(range(y_LL, y_UL, y_interval),[str(y) for y in range(y_LL, y_UL, y_interval)],fontsize=12)plt.xticks(range(0, df.shape[0], 12),df.date.values[::12],horizontalalignment='left',rotation=45,fontsize=12)plt.ylim(y_LL, y_UL)plt.xlim(-2, 80)plt.show()
42、双坐标系时间序列图(Plotting with different scales using secondary Y axis)# Import Datadf = pd.read_csv("./datasets/economics.csv")x = df['date']y1 = df['psavert']y2 = df['unemploy']# Plot Line1 (Left Y Axis)fig, ax1 = plt.subplots(1, 1, figsize=(12, 6), dpi=100)ax1.plot(x, y1, color='tab:red')# Plot Line2 (Right Y Axis)ax2 = ax1.twinx() # instantiate a second axes that shares the same x-axisax2.plot(x, y2, color='tab:blue')# Decorations# ax1 (left Y axis)ax1.set_xlabel('Year', fontsize=18)ax1.tick_params(axis='x', rotation=70, labelsize=12)ax1.set_ylabel('Personal Savings Rate', color='#dc2624', fontsize=16)ax1.tick_params(axis='y', rotation=0, labelcolor='#dc2624')ax1.grid(alpha=.4)# ax2 (right Y axis)ax2.set_ylabel("# Unemployed (1000's)", color='#01a2d9', fontsize=16)ax2.tick_params(axis='y', labelcolor='#01a2d9')ax2.set_xticks(np.arange(0, len(x), 60))ax2.set_xticklabels(x[::60], rotation=90, fontdict={'fontsize': 10})ax2.set_title("Personal Savings Rate vs Unemployed: Plotting in Secondary Y Axis",fontsize=18)fig.tight_layout()plt.show()
43、带误差阴影的时间序列图(Time Series with Error Bands)from dateutil.parser import parsefrom scipy.stats import sem# Import Datadf_raw = pd.read_csv('./datasets/orders_45d.csv',parse_dates=['purchase_time', 'purchase_date'])# Prepare Data: Daily Mean and SE Bandsdf_mean = df_raw.groupby('purchase_date').quantity.mean()df_se = df_raw.groupby('purchase_date').quantity.apply(sem).mul(1.96)# Plotplt.figure(figsize=(10, 6), dpi=80)plt.ylabel("# Daily Orders", fontsize=12)x = [d.date().strftime('%Y-%m-%d') for d in df_mean.index]plt.plot(x, df_mean, color="#c72e29", lw=2)plt.fill_between(x, df_mean - df_se, df_mean + df_se, color="#f8f2e4")# Decorations# Lighten bordersplt.gca().spines["top"].set_alpha(0)plt.gca().spines["bottom"].set_alpha(1)plt.gca().spines["right"].set_alpha(0)plt.gca().spines["left"].set_alpha(1)plt.xticks(x[::6], [str(d) for d in x[::6]], fontsize=12)plt.title("Daily Order Quantity of Brazilian Retail with Error Bands (95% confidence)",fontsize=14)# Axis limitss, e = plt.gca().get_xlim()plt.xlim(s, e - 2)plt.ylim(4, 10)# Draw Horizontal Tick linesfor y in range(5, 10, 1):plt.hlines(y,xmin=s,xmax=e,colors='black',alpha=0.5,linestyles="--",lw=0.5)plt.show()
44、堆积面积图(Stacked Area Chart)# Import Datadf = pd.read_csv('./datasets/nightvisitors.csv')# Decide Colors mycolors = ['#dc2624', '#2b4750', '#45a0a2', '#e87a59', '#7dcaa9', '#649E7D', '#dc8018', '#C89F91'] # Draw Plot and Annotatefig, ax = plt.subplots(1,1,figsize=(12, 8), dpi= 80)columns = df.columns[1:]labs = columns.values.tolist()# Prepare datax = df['yearmon'].values.tolist()y0 = df[columns[0]].values.tolist()y1 = df[columns[1]].values.tolist()y2 = df[columns[2]].values.tolist()y3 = df[columns[3]].values.tolist()y4 = df[columns[4]].values.tolist()y5 = df[columns[5]].values.tolist()y6 = df[columns[6]].values.tolist()y7 = df[columns[7]].values.tolist()y = np.vstack([y0, y2, y4, y6, y7, y5, y1, y3])# Plot for each columnlabs = columns.values.tolist()ax = plt.gca()ax.stackplot(x, y, labels=labs, colors=mycolors, alpha=0.8)ax.tick_params(axis='x', rotation=45, labelsize=12)# Decorationsax.set_title('Night Visitors in Australian Regions', fontsize=18)ax.set(ylim=[0, 100000])ax.legend(fontsize=10, ncol=4)plt.xticks(x[::5], fontsize=10, horizontalalignment='center')plt.yticks(np.arange(10000, 100000, 20000), fontsize=10)plt.xlim(x[0], x[-1])# Lighten bordersplt.gca().spines["top"].set_alpha(0)plt.gca().spines["bottom"].set_alpha(.3)plt.gca().spines["right"].set_alpha(0)plt.gca().spines["left"].set_alpha(.3)plt.show()
45、非堆积面积图(Area Chart UnStacked)# Import Datadf = pd.read_csv("./datasets/economics.csv")# Prepare Datax = df['date'].values.tolist()y1 = df['psavert'].values.tolist()y2 = df['uempmed'].values.tolist()columns = ['psavert', 'uempmed']# Draw Plotfig, ax = plt.subplots(1, 1, figsize=(12, 6), dpi=80)ax.fill_between(x,y1=y1,y2=0,label=columns[1],alpha=0.5,color='#dc2624',linewidth=2)ax.fill_between(x,y1=y2,y2=0,label=columns[0],alpha=0.5,color='#649E7D',linewidth=2)# Decorationsax.set_title('Personal Savings Rate vs Median Duration of Unemployment',fontsize=18)ax.set(ylim=[0, 30])ax.legend(loc='best', fontsize=12)plt.xticks(x[::50], fontsize=10, horizontalalignment='center')plt.yticks(np.arange(2.5, 30.0, 2.5), fontsize=10)plt.xlim(-10, x[-1])plt.tick_params(axis='x', rotation=45, labelsize=12)# Draw Tick linesfor y in np.arange(2.5, 30.0, 2.5):plt.hlines(y,xmin=0,xmax=len(x),colors='black',alpha=0.3,linestyles="--",lw=0.5)# Lighten bordersplt.gca().spines["top"].set_alpha(0)plt.gca().spines["bottom"].set_alpha(.3)plt.gca().spines["right"].set_alpha(0)plt.gca().spines["left"].set_alpha(.3)plt.show()
46、日历热力图(Calendar Heat Map)很好地展示数据在假日的趋势。
!pip install calmap -i https://pypi.tuna.tsinghua.edu.cn/simple#安装依赖包import numpy as npnp.random.seed(sum(map(ord, 'calmap')))import pandas as pdimport calmapcalmap.calendarplot(events,monthticks=3,daylabels='MTWTFSS',dayticks=[0, 2, 4, 6],cmap='YlGn',fillcolor='grey',linewidth=0,fig_kws=dict(figsize=(8, 4)))
47、季节图(Seasonal Plot)该图比较某个指标在不同年份同一天/年/月/周等的时间序列的表现。
from dateutil.parser import parse# Import Datadf = pd.read_csv('./datasets/AirPassengers.csv')# Prepare datadf['year'] = [parse(d).year for d in df.date]df['month'] = [parse(d).strftime('%b') for d in df.date]years = df['year'].unique()# Draw Plotmycolors = ['#dc2624', '#2b4750', '#45a0a2', '#e87a59', '#7dcaa9', '#649E7D','#dc8018', '#C89F91', '#6c6d6c', '#4f6268', '#c7cccf', 'firebrick']plt.figure(figsize=(10, 6), dpi=80)for i, y in enumerate(years):plt.plot('month','value',data=df.loc[df.year == y, :],color=mycolors[i],label=y)plt.text(df.loc[df.year == y, :].shape[0] - .9,df.loc[df.year == y, 'value'][-1:].values[0],y,fontsize=12,color=mycolors[i])# Decorationplt.ylim(50, 750)plt.xlim(-0.3, 11)plt.ylabel('$Air Traffic)plt.yticks(fontsize=11, alpha=.7)plt.xticks(fontsize=11, alpha=.7)plt.title("Monthly Seasonal Plot: Air Passengers Traffic (1949 - 1969)",fontsize=16)plt.grid(axis='y', alpha=.3)# Remove bordersplt.gca().spines["top"].set_alpha(0.0)plt.gca().spines["bottom"].set_alpha(0.5)plt.gca().spines["right"].set_alpha(0.0)plt.gca().spines["left"].set_alpha(0.5)# plt.legend(loc='upper right', ncol=2, fontsize=12)plt.show()
七、分组( Groups)关系图48、聚类树形图(Dendrogram)展示通过聚类形成的组内及组间相似性水平。
import scipy.cluster.hierarchy as shc# Import Datadf = pd.read_csv('./datasets/USArrests.csv')# Plotplt.figure(figsize=(12, 8), dpi=80)plt.title("USArrests Dendograms", fontsize=18)dend = shc.dendrogram(shc.linkage(df[['Murder', 'Assault', 'UrbanPop','Rape']],method='ward'),labels=df.State.values,color_threshold=200)plt.xticks(fontsize=12)plt.yticks(fontsize=12)plt.show()
49、聚类图(Cluster Plot)通过聚类计算距离,将同一类圈起来。
from sklearn.cluster import AgglomerativeClusteringfrom scipy.spatial import ConvexHull# Import Datadf = pd.read_csv('./datasets/USArrests.csv')# Agglomerative Clusteringcluster = AgglomerativeClustering(n_clusters=5,affinity='euclidean',linkage='ward')cluster.fit_predict(df[['Murder', 'Assault', 'UrbanPop', 'Rape']])# Plotplt.figure(figsize=(12, 8), dpi=80)plt.scatter(df.iloc[:, 0], df.iloc[:, 1], c=cluster.labels_, cmap='tab10')# Encircledef encircle(x, y, ax=None, **kw):if not ax: ax = plt.gca()p = np.c_[x, y]hull = ConvexHull(p)poly = plt.Polygon(p[hull.vertices, :], **kw)ax.add_patch(poly)# Draw polygon surrounding verticesencircle(df.loc[cluster.labels_ == 0, 'Murder'],df.loc[cluster.labels_ == 0, 'Assault'],ec="k",fc="#dc2624",linewidth=0)encircle(df.loc[cluster.labels_ == 1, 'Murder'],df.loc[cluster.labels_ == 1, 'Assault'],ec="k",fc="#2b4750",linewidth=0)encircle(df.loc[cluster.labels_ == 2, 'Murder'],df.loc[cluster.labels_ == 2, 'Assault'],ec="k",fc="#649E7D",linewidth=0)encircle(df.loc[cluster.labels_ == 3, 'Murder'],df.loc[cluster.labels_ == 3, 'Assault'],ec="k",fc="#C89F91",linewidth=0)encircle(df.loc[cluster.labels_ == 4, 'Murder'],df.loc[cluster.labels_ == 4, 'Assault'],ec="k",fc="#c7cccf",linewidth=0)# Decorationsplt.xlabel('Murder')plt.xticks(fontsize=12)plt.ylabel('Assault')plt.yticks(fontsize=12)plt.title('Agglomerative Clustering of USArrests (5 Groups)', fontsize=18)plt.show()
50、安德鲁斯曲线(Andrews Curve)展示是否存在基于给定分组的特征的固有分组。例如下图,如果数据集中的列不能帮助区分组(cyl),则行将不会被很好地分隔开。
from pandas.plotting import andrews_curves# Importdf = pd.read_csv("./datasets/mtcars.csv")df.drop(['cars', 'carname'], axis=1, inplace=True)# Plotplt.figure(figsize=(10, 6), dpi=80)andrews_curves(df, 'cyl', colormap='Set2_r')# Lighten bordersplt.gca().spines["top"].set_alpha(0)plt.gca().spines["bottom"].set_alpha(.3)plt.gca().spines["right"].set_alpha(0)plt.gca().spines["left"].set_alpha(.3)plt.title('Andrews Curves of mtcars', fontsize=18)plt.xlim(-3, 3)plt.grid(alpha=0.3)plt.xticks(fontsize=12)plt.yticks(fontsize=12)plt.show()
51、平行坐标图(Parallel Coordinates)展示某个特征是否有助于分组。如果一个特征隔离,分组受到影响,则该特征对该分组非常必要。
from pandas.plotting import parallel_coordinates# Import Datadf_final = pd.read_csv("./datasets/diamonds_filter.csv")# Plotplt.figure(figsize=(11, 7), dpi=80)parallel_coordinates(df_final, 'cut', colormap='Set2_r')# Lighten bordersplt.gca().spines["top"].set_alpha(0)plt.gca().spines["bottom"].set_alpha(.3)plt.gca().spines["right"].set_alpha(0)plt.gca().spines["left"].set_alpha(.3)plt.title('Parallel Coordinated of Diamonds', fontsize=18)plt.grid(alpha=0.3)plt.xticks(fontsize=12)plt.yticks(fontsize=12)plt.show()
asp网页的显示时间代码怎么写?
asp中有固定的内置函数定义当前时间
获取当前系统日期和时间,ASP输出可以这样写:<%=now()%>
获取年份, ASP输出:<%=Year(now())%>
获取当前月份,ASP输出:<%=Month(now())%>
获取当天数,ASP输出:<%=day(now())%>
获取分钟数,ASP输出:<%=Minute(now())%>
获取秒钟数,ASP输出:<%=Second(now())%>
获取当前系统日期,格式为:2004-2-28
获取当前系统时间,格式为:22:24:59
如果想时间一直在动 则需要JS代码来完成
首先定义一个ID为clock的DIV
然后在网页上部定上 如下JS代码
<script type="text/javascript"> function changeClock() { var d = new Date(); document.getElementById("clock").innerHTML = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds(); } window.setInterval(changeClock, 1000); </script>
750主要引入了哪些变化?
Mozilla在2020年4月7日将Firefox 75发布到Windows,macOS和Linux的Stable桌面频道,其中包含错误修复,新功能和安全修复。
今天的发行版包括Windows 10用户的性能改进,地址栏搜索的改进以及通过本地缓存某些受信任证书而提高的HTTPS兼容性。
Windows,Mac和Linux桌面用户可以通过转到选项 -> 帮助 -> 关于Firefox 升级到Firefox 75,浏览器将自动检查新更新并在可用时进行安装。
随着Firefox 75的发布,所有其他Firefox开发分支也都升级了版本,将Firefox Beta升级到了76版,将Nightly版本升级到了77版。
您可以从以下链接下载Firefox 75:
适用于Windows 64位的Firefox 75
适用于Windows 32位的Firefox 75
适用于macOS的Firefox 75
用于Linux 64位的Firefox 75
适用于Linux 32位的Firefox 75
如果上述链接尚未针对Firefox 75进行更新,则还可以从Mozilla的FTP版本目录手动下载它。
改进的Windows 10性能,flatpaks等Firefox 75保证了在运行Windows 10的设备上的更好性能,这是由于DirectComposition的集成,借助基于WebRender GPU的2D渲染引擎进一步改善了内置Intel显卡的笔记本电脑的渲染。
Mozilla说:“ Direct Composition已在Windows上为我们的用户集成,以帮助改善性能,并使我们正在进行的工作能够在装有Intel显卡的Windows 10笔记本电脑上发布WebRender。”
从此版本开始,Firefox也以Flatpak应用程序分发格式提供,这使得在基于Linux的系统上安装Web浏览器变得更加容易和安全。
Firefox 75还将在本地缓存Mozilla知道的所有受信任的Web PKI证书颁发机构证书,从而直接提高安全性和HTTPS与配置错误的Web服务器的兼容性。
通过改版的地址栏更快地搜索Mozilla还通过每次启动搜索时放大Firefox 75来刷新地址栏的外观,以及“在单个视图中使用更大的字体,更短的URL对其进行简化,调整为多种大小以及最快捷的快捷方式。热门网站进行搜索。”
内置的搜索引擎现在也更加智能,因为它会根据您的书签,历史记录或流行网站中的网站为您提供粗体搜索建议和自动完成功能。
Firefox 75的地址栏还将在地址栏下方显示您的热门站点(最近访问和最常访问的站点或您固定的站点),以便快速轻松地访问。
这是与改进的搜索和地址栏相关的更改的完整列表:
集中,干净的搜索体验,针对较小的笔记本电脑屏幕进行了优化;现在,当您选择地址时,就会出现热门网站;以新的搜索词为重点,提高了搜索建议的可读性;建议包括针对Firefox常见问题的解决方案;在Linux上,单击地址栏和搜索栏时的行为现在与其他桌面平台相匹配:单击一次即可选择全部而没有主要选择,双击选择一个单词,而三次单击则全部选择了主要选择。修复安全漏洞Mozilla还修复了Firefox 75中的六个安全漏洞,其中三个漏洞的严重性为高,另外三个漏洞的安全性为中等。相对于其他错误修复,改进和开发人员有以下更改。
企业:
通过将首选项设置security.osclientcerts.autoload 为true,可以在macOS上启用对使用来自OS证书存储区的客户端证书的实验支持 。
企业策略可用于排除域,使其无法使用基于HTTPS的DNS通过TRR(受信任的递归解析器)进行解析。
开发者:
通过使用 元素上的load属性,可以节省带宽并减少浏览器的内存 。默认的“ eager”值将立即加载图像,而“ lazy”值将延迟加载,直到图像在视口范围内为止。
控制台表达式的即时评估使开发人员比以前更快地识别和修复错误。只要在Web控制台中键入的表达式没有副作用,它们的结果将在您输入时会进行预览。
如何处理AWR快照不自动收集的问题?
AWR快照不自动收集可能是由于以下原因造成的:
1. AWR自动快照收集被禁用了
2. AWR自动快照收集的时间间隔设置不正确
3. AWR表空间已满或空间不足
4. 数据库处于备份,恢复或其他维护模式
解决这个问题可以采取以下步骤:
1. 确保AWR自动快照收集功能是启用的,可以使用下面的SQL查询检查:
SELECT client_name, status FROM dba_autotask_client;
2. 如果AWR自动快照收集功能已启用,请检查AWR快照收集的时间间隔设置是否正确。可以通过以下SQL查询进行检查:
SELECT client_name, window_group, repeat_interval FROM dba_autotask_window_client;
3. 如果AWR表空间已满或空间不足,请考虑增加AWR表空间的大小或清理旧的AWR快照数据。可以使用以下SQL查询检查AWR表空间的使用情况:
SELECT tablespace_name, used_space_mb, free_space_mb FROM dba_tablespace_usage_metrics WHERE tablespace_name LIKE 'SYSAUX%';
4. 最后,如果数据库处于备份,恢复或其他维护模式,请等待操作完成后再尝试收集AWR快照。
如果以上方法都不能解决AWR快照不自动收集的问题,您可以考虑联系Oracle支持部门以获取更多帮助和支持。


还没有评论,来说两句吧...