将数据帧转换为要在python函数中传递的格式
我对python有点陌生,正在研究将数组转换为需要在函数中传递的格式的需求将数据帧转换为要在python函数中传递的格式,python,arrays,list,format,random-forest,Python,Arrays,List,Format,Random Forest,我对python有点陌生,正在研究将数组转换为需要在函数中传递的格式的需求 array([['max_depth', 25], ['min_samples_leaf', 1], ['min_samples_split', 2], ['n_estimators', 300]], dtype=object) 所需格式: RandomForestClassifier(**random_state = 1,
array([['max_depth', 25],
['min_samples_leaf', 1],
['min_samples_split', 2],
['n_estimators', 300]], dtype=object)
所需格式:
RandomForestClassifier(**random_state = 1,
n_estimators = 300,
max_depth = 25,
min_samples_split = 2, min_samples_leaf = 1**)
第二个灰色区域是我喜欢的值数组中的灰色区域,另外random_state=1
有人能帮忙吗