import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
iris = load_iris()
iris_feature = iris.data
iris_target = iris.target
iris_f = np.ones(iris_feature.shape)
iris_t = np.ones(iris_target.shape)
iris_joint = np.concatenate((iris_feature,iris_f),axis=0)
iris_joint2 = np.concatenate((iris_target,iris_t),axis=0)
结果
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
iris = load_iris()
iris_feature = iris.data
iris_target = iris.target
iris_f = np.ones(iris_feature.shape)
iris_t = np.ones(iris_target.shape)
iris_target = iris_target.reshape(len(iris_target),1)
iris_t = iris_t.reshape(len(iris_t),1)
iris_joint = np.concatenate((iris_feature,iris_f),axis=0)
iris_joint2 = np.concatenate((iris_target,iris_t),axis=0)
结果