我有以下表格
import numpy as np
import pandas as pd
from kmodes import kmodes
df_dummy = pd.get_dummies(df)
#transform into numpy array
x = df_dummy.reset_index().values
km = kmodes.KModes(n_clusters=3, init='Huang', n_init=5, verbose=0)
clusters = km.fit_predict(x)
df_dummy['clusters'] = clusters
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
pca = PCA(2)
# Turn the dummified df into two columns with PCA
plot_columns = pca.fit_transform(df_dummy.ix[:,0:12])
# Plot based on the two dimensions, and shade by cluster label
plt.scatter(x=plot_columns[:,1], y=plot_columns[:,0], c=df_dummy["clusters"], s=30)
plt.show()
有没有办法检查表单是否在其中一个控件上有必填字段?
由于
答案 0 :(得分:0)
您可以通过在控制台中打印表单对象来检查这一点。