Dear Python lovers,
I am in urgent need of some assistance. I am stuck with a seemingly simple task, just can't wrap my head around the slicing part for some reason:/
My task is:
Create a dictionary and name it cc. The dictionary has two keys: data and target, and the corresponding key values are NumPy arrays. For target, the key value is an array of values from the encoded column satisfaction of df. For data, the key value is an array of sub arrays and each sub array is an observation of one sample across the features in df2.
My code is:
Please help!
I am in urgent need of some assistance. I am stuck with a seemingly simple task, just can't wrap my head around the slicing part for some reason:/
My task is:
Create a dictionary and name it cc. The dictionary has two keys: data and target, and the corresponding key values are NumPy arrays. For target, the key value is an array of values from the encoded column satisfaction of df. For data, the key value is an array of sub arrays and each sub array is an observation of one sample across the features in df2.
My code is:
cc = { "data": df_final_pd.iloc[:0, :].to_numpy(), "target": df_final_pd["satisfaction"].to_numpy(), } ccIt gives me a NameError: name 'df_final_pd' is not defined but I am not sure if the slicing is ok? Also, 'df_final_pd' is previously defined. It's so weird.
Please help!
buran write Nov-24-2020, 09:26 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.