This commit is contained in:
Yevhenii Poliakov 2023-05-14 21:37:56 +02:00
parent 83ee7775df
commit 7e2f575328

View File

@ -13,9 +13,9 @@ 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 = 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'].values.astype(float) y = data['Rating'].values.astype('float64')
print("Data type of 'Rating' column:", y.dtype) print("Data type of 'Rating' column:", y.dtype)