Skip to content

Tag: dataframe

Too many indices for array | python

I’m trying to copy arrays to a pandas Dataframe and get the error “too many indices for array”. The error occurs in these lines: pr_daily and rad_daily are numpy arrays of of the same length. Traceback (most recent call last): File “C:Users…Downloadspython_scriptspv.py”, li…

Mapping from a different dataframe

I have a dataset of patients, e.g.: and a dataset of diseases of each patient (by ICD code): How can I flag each patient if he had history of a specific ICD code, desired output: I am currently doing it with iteration but this takes too long…. Answer If need indicators – it means only 0, 1 values …