从技术上讲,我已经使用
安装了pandas-profiling pip install pandas-profiling
但是当我尝试导入它时,出现以下错误:
import numpy as np
import pandas as pd
import pandas_profiling
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-e1a23f2a6f04> in <module>()
1 import numpy as np
2 import pandas as pd
3 import pandas_profiling
ModuleNotFoundError: No module named 'pandas_profiling'
所以我尝试在Jupyter Notebook中安装它,并且也收到以下错误:
import sys
!{sys.executable} -m pip install pandas-profiling
Collecting pandas-profiling
Could not find a version that satisfies the requirement pandas-profiling
(from versions: )
No matching distribution found for pandas-profiling
由于某种原因,由于无法建立与conda.anaconda.org的连接,我也无法同时使用conda进行安装。
答案 0 :(得分:1)
基于评论,我能够找出问题所在。我必须在Anaconda root env外部安装jupyter笔记本,然后从终端打开它。
pip3 install jupyter notebook
一旦我正确地导入了它。
答案 1 :(得分:0)
步骤:
cd C:\ Users \ farah \ Downloads \ pandas-profiling-master \ pandas-profiling-master
然后键入python setup.py install
现在您可以使用:
import pandas_profiling as pp df = pd.read_csv('1234.csv') pp.ProfileReport(df)
答案 2 :(得分:0)
对于其他希望解决此问题的人,请尝试以下替代步骤:
WITH CTE AS(
SELECT ID,
Email,
ROW_NUMBER() OVER (PARTITION BY ID ORDER BY Email_Date DESC) AS Email_RN,
Phone,
ROW_NUMBER() OVER (PARTITION BY ID ORDER BY Phone_Date DESC) AS Phone_RN
FROM YourTable)
SELECT ID,
MAX(CASE Email_RN WHEN 1 THEN Email END) AS Email,
MAX(CASE Phone_RN WHEN 1 THEN Phone END) AS Phone
FROM CTE
GROUP BY ID;
命令。