ValueError: Shape of passed values is (1, 6), indices imply (6, 6)

Simply change col = pd.DataFrame(data, columns=[‘runs’,’balls’, ‘wickets’, ‘ground_average’, ‘pp_balls_left’, ‘total_overs’]) for col = pd.DataFrame([data], columns=[‘runs’,’balls’, ‘wickets’, ‘ground_average’, ‘pp_balls_left’, ‘total_overs’]) You want [data] for pandas to understand they’re rows. Simple illustration: a = [1, 2, 3] >>> pd.DataFrame(a) 0 0 1 1 2 2 3 >>> pd.DataFrame([a]) 0 1 2 0 1 2 3

sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)

This might happen inside scikit, and it depends on what you’re doing. I recommend reading the documentation for the functions you’re using. You might be using one which depends e.g. on your matrix being positive definite and not fulfilling that criteria. EDIT: How could I miss that: np.isnan(mat.any()) #and gets False np.isfinite(mat.all()) #and gets True … Read more