参考博客
https://blog.csdn.net/weixin_42512684/article/details/107461383
import numpy as np
import pandas as pd
x=np.array([[1,2,3],[2,3,4],[1,2,2],[1,2,2]])
df=pd.DataFrame(x)
print(df)
import pandas as pd
import numpy as np
from sklearn import datasets
iris = datasets.load_iris()
data = pd.concat([pd.DataFrame(iris.target, columns = ['target']), pd.DataFrame(iris.data, columns = iris.feature_names)], axis = 1)
def target_replace(x):
for i in [0,1,2]:
if x == i:
return(iris.target_names[i]) # 对某一类进行操作