Pls share the screen snap of it

# Perform Dimensionality Reduction

from sklearn.decomposition import PCA

# define your object preserving 95% variance

pca=PCA(.95,svd_solver="full")

# fit training data

pca.fit(X_train)

# Tranform X_train, X_test and new_data

X_train = pca.transform(X_train)

X_test = pca.transform(X_test)

new_data = pca.transform(new_data)

Error:

---------------------------------------------------------------------------

ValueError Traceback (most recent call last)

<ipython-input-13-ccaebc730fe1> in <module>

14

15 X_train = pca.transform(X_train)

---> 16X_test = pca.transform(X_test)

17 new_data = pca.transform(new_data)

/usr/local/lib/python3.7/site-packages/sklearn/decomposition/_base.py in transform(self, X)

125 check_is_fitted(self)

126

--> 127X = check_array(X)

128 if self.mean_ is not None:

129 X = X - self.mean_

/usr/local/lib/python3.7/site-packages/sklearn/utils/validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, warn_on_dtype, estimator)

576 if force_all_finite:

577 _assert_all_finite(array,

--> 578 allow_nan=force_all_finite == 'allow-nan')

579

580 if ensure_min_samples > 0:

/usr/local/lib/python3.7/site-packages/sklearn/utils/validation.py in _assert_all_finite(X, allow_nan, msg_dtype)

58 msg_err.format

59 (type_err,

---> 60 msg_dtype if msg_dtype is not None else X.dtype)

61 )

62 # for object dtype data, we only check for NaNs (GH-13254)

ValueError: Input contains NaN, infinity or a value too large for dtype('float64').