DictVectorizer
import sklearnfrom sklearn.feature_extraction import DictVectorizerdef dictvect(): vect = DictVectorizer(sparse=False) data = vect.fit_transform([{"city":"bj","temperature":20},{"city":"sh",&quo