Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

05_Interacting_with_Campaigns_and_Filters.ipynb - loading in .csv file with title cast as str and then reference as int #154

Open
t10b opened this issue Mar 27, 2023 · 0 comments

Comments

@t10b
Copy link

t10b commented Mar 27, 2023

noticed I was getting key errors when running through the notebook:
05_Interacting_with_Campaigns_and_Filters.ipynb

when reading in the dataframe from the .csv, we cast title( a unique integer value) as 'str' - but all the following code references it as being cast as 'int'.
Easy fix is to change the following:

Create a dataframe for the items by reading in the correct source CSV

items_df = pd.read_csv(dataset_dir + '/movies.csv', sep=',', usecols=[0,1], encoding='latin-1', dtype={'movieId': "object", 'title': "str"},index_col=0)
to

Create a dataframe for the items by reading in the correct source CSV

items_df = pd.read_csv(dataset_dir + '/movies.csv', sep=',', usecols=[0,1], encoding='latin-1', dtype={'movieId': "object", 'title': "int"},index_col=0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant