Created
June 21, 2020 10:51
-
-
Save shubham1710/ed3cd60a3c6f52fa27f1ee6f7cac88df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
movie = pd.read_csv("moviedata.csv") | |
features = ['keywords','cast','genres','director','tagline'] | |
for feature in features: | |
movie[feature] = movie[feature].fillna('') | |
def combine_features(row): | |
try: | |
return row['keywords'] +" "+row['cast']+" "+row['genres']+" "+row['director']+" "+row['tagline'] | |
except: | |
print ("Error:", row) | |
movie["combined_features"] = movie.apply(combine_features,axis=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment