What's the correct way to applyzscore(or an equivalent function not from scipy) to a column of a pandas dataframe and have it ignore thenanvalues? I'd like it to be same dimension as original column withnp.nanfor values that can't be normalized ...
1 I have synthetically generated a 10k row dataset using this code: importnumpyasnpimportpandasaspdimportrandom, stringfor_inrange(10000): row = {'foo':f'{np.random.randint(1000,10000)}_{np.random.randint(100,1000)}_{''.join(random.choices(string.ascii_uppercase, k=3)...
Sometimes, it may be more descriptive to add prefixes for the column names. To do that for themetaandrecord_path, we can simply pass the string to the argumentmeta_prefixandrecord_prefixrespectively: pd.json_normalize( data, record_path=['students'], meta=['class'], meta_prefix='meta-...