This commit is contained in:
Yevhenii Poliakov 2023-05-14 21:34:40 +02:00
parent da57700f7b
commit 83ee7775df

View File

@ -13,7 +13,8 @@ data = pd.read_csv('data.csv')
# Prepare the data # Prepare the data
X = data[['movie title', 'User Rating', 'Director', 'Top 5 Casts', 'Writer']] X = data[['movie title', 'User Rating', 'Director', 'Top 5 Casts', 'Writer']]
y = pd.Series(data['Rating'], dtype=float) 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 = data['Rating'].values.astype(float) # y = data['Rating'].values.astype(float)
print("Data type of 'Rating' column:", y.dtype) print("Data type of 'Rating' column:", y.dtype)