【发布时间】:2020-08-26 14:49:30
【问题描述】:
当我使用 pandas-profiling==2.8.0 分析以下数据时,它不会返回最小值、最大值和平均值。
CSV 数据
a,b,c
12,2.5,0
12,4.7,5
33,5,4
44,44.21,67
python 代码
import json
import pandas as pd
from pandas_profiling import ProfileReport
def profile_report(data):
dataset = data.select_dtypes(include=['int64', 'float64'])
profile=ProfileReport(dataset, minimal=True)
json_data=profile.to_json()
results = json.loads(json_data)
print(json.dumps(results, indent=4))
if __name__ == "__main__":
df = pd.read_csv('data.csv',index_col=None)
profile_report(df)
在某些情况下,它可以正常工作并返回最小值、最大值和平均值。但是当我执行上面的 csv 数据时,它不会返回该值
【问题讨论】:
标签: python-3.x pandas python-3.6 pandas-profiling data-profiling