won*_*rit 6 python pandas pandas-profiling
我从 kaggle 下载了泰坦尼克号数据集。我正在通过安装 pandas_profiling 来实现 pandas 的分析
我们将不胜感激您的贡献!
import pandas as pd
df = pd.read_csv('E:/pythonWorkspace/excelFiles/train.csv')
df.head()
from pandas_profiling import ProfileReport
prof = ProfileReport(df) #object created!
prof.to_file(output_file='output.html')
Run Code Online (Sandbox Code Playgroud)
错误 :
PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.0.2/migration/#basesettings-has-moved-to-pydantic-settings for more details.
For further information visit https://errors.pydantic.dev/2.0.2/u/import-error
Run Code Online (Sandbox Code Playgroud)
小智 9
首先你需要安装ydata-profiling:
pip install ydata-profiling
Run Code Online (Sandbox Code Playgroud)
然后:
import pandas as pd
from ydata_profiling import ProfileReport
# Read the data from a csv file
df = pd.read_csv("data.csv")
# Generate the data profiling report
report = ProfileReport(df, title='My Data')
report.to_file("my_report.html")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9497 次 |
| 最近记录: |