Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ValueError使用Pandas\u评测呈现html报告时出错_Python_Pandas_Pandas Profiling - Fatal编程技术网

Python ValueError使用Pandas\u评测呈现html报告时出错

Python ValueError使用Pandas\u评测呈现html报告时出错,python,pandas,pandas-profiling,Python,Pandas,Pandas Profiling,在为数据帧的子集运行概要文件报告时,我遇到以下错误 ValueError:值“6.180529706513958”应为1和0之间的比率。 这项工作: profile=ProfileReport( df,title=“一月转换数据集的概要报告” ) profile.to_文件(路径(“../../../products/jan_cvr_report.html”)) profile0=ProfileReport( df[df['conversion']==0],title=“一月转换的概要报告==

在为数据帧的子集运行概要文件报告时,我遇到以下错误

ValueError:值“6.180529706513958”应为1和0之间的比率。
这项工作:

profile=ProfileReport(
df,title=“一月转换数据集的概要报告”
)
profile.to_文件(路径(“../../../products/jan_cvr_report.html”))
profile0=ProfileReport(
df[df['conversion']==0],title=“一月转换的概要报告==0数据集”
)
profile0.to_文件(路径(“../../../products/jan_cvr0_report.html”))
这并不是:

profile1=ProfileReport(
df[df['conversion']==1],title=“一月转换的概要报告==1数据集”
)
profile1.to_文件(路径(“../../../products/jan_cvr1_report.html”))
我找到了一个建议我去工作的人。我的详细资料和堆栈跟踪都在那里

解决方案:

df1=df[df['conversion']=1]。复制(deep=True)
df1.user\u id.cat.remove\u unused\u类别(inplace=True)
运行上述操作后,概要文件报告工作正常。这些类极不平衡,因此当子集设置为
conversion=1
时,大多数
用户ID
都不会被使用。这也可以通过不将
用户id
作为一个类别来解决。然而,这可能是其他类别的问题,所以我还是分享