我试图用Python来计算数据文件中对象变量的长度。我的许多变量都是带有缺失值的字符串,不幸的是,当我试图计算缺失值的长度时,它显示为3(因为它将"Nan“作为一个3个字符值)。下面是我正在使用的代码:
df_string_mean_with_na = pd.DataFrame(df_string.applymap(len).astype(int).mean().to_dict(), in
因此,问题是:我将对象的列表/数组从前端传递给我的节点js后端。这就是前端的样子:{"sample1":" This ","apple2“:eat},{"sample2":"thisIs2","apple3”:eatFruits}{“sample1”:"this","apple2“:eat},{"sa