update script4
This commit is contained in:
parent
75381edb56
commit
d4a8245390
@ -22,7 +22,7 @@ try:
|
||||
except pd.errors.ParserError as e:
|
||||
print(f"Error occurred while parsing the dataset: {e}")
|
||||
print("Dropping rows with inconsistent number of columns...")
|
||||
data = data[data.apply(lambda x: len(x) == 12 if isinstance(x, list) else True, axis=1)]
|
||||
data = data[~data.apply(lambda x: len(x) != 12, axis=1)]
|
||||
|
||||
# Convert categorical variables to numerical representations
|
||||
data = pd.get_dummies(data, columns=['Genres', 'Director Name', 'Writer Name'])
|
||||
|
Loading…
Reference in New Issue
Block a user