Skip to content

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

@t10b

Description

@t10b

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions