upd51
This commit is contained in:
parent
b97f78deb4
commit
b0f6275019
@ -16,6 +16,9 @@ X = data[['movie title', 'User Rating', 'Director', 'Top 5 Casts', 'Writer']]
|
|||||||
#y = data['Rating'].apply(lambda x: float(x) if isinstance(x, (int, float)) else np.nan) # Convert 'Rating' column to float data type
|
#y = data['Rating'].apply(lambda x: float(x) if isinstance(x, (int, float)) else np.nan) # Convert 'Rating' column to float data type
|
||||||
#y = pd.Series(data['Rating'], dtype=float)
|
#y = pd.Series(data['Rating'], dtype=float)
|
||||||
y = data['Rating'].astype('float64')
|
y = data['Rating'].astype('float64')
|
||||||
|
y = y.fillna(y.mean())
|
||||||
|
y = np.array(y)
|
||||||
|
|
||||||
|
|
||||||
print("Data type of 'Rating' column:", y.dtype)
|
print("Data type of 'Rating' column:", y.dtype)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user