-2

I am facing an issue regarding in python , when I import the csv file in python it is showing the data in VSCode. means file is running and successfully imported but when I want to create a report of same csv file by using from pandas_profiling import ProfileReport it shows me an error code and error mentioned:

import pandas as pd
from pandas_profiling import ProfileReport

df = pd.read_csv('housing.csv')
print(df)

profile = ProfileReport(df)
profile.to_file(output_file ="housing.html")

enter image description here

I want to generate **Pandas Profiling Report **

Saeed
  • 3
  • 2
  • Check out this [questions](https://stackoverflow.com/questions/74996550/pandas-profiling-not-able-to-import-due-to-error-cannot-import-name-dataerror). Does it fix your error? – Ftagliacarne Feb 01 '23 at 08:14
  • 1
    Also, please [do not upload picture of your code or tracebacks](https://stackoverflow.com/help/how-to-ask), instead provide the traceback as code, it makes it easier to look at. – Ftagliacarne Feb 01 '23 at 08:16
  • HI @Ftagliacarne thankyou for replying , but the reference link not working in this case – Saeed Feb 01 '23 at 08:40
  • You are importing from pandas_profiling, but the repo states that you should be importing from ydata_profiling instead. Does that solve your problem? What error codes do you get? – kakben Feb 01 '23 at 08:52
  • ydata_profiling? i dont know how to modify in this code. – Saeed Feb 01 '23 at 09:10
  • @SaeedAhsan https://stackoverflow.com/questions/74996550/pandas-profiling-not-able-to-import-due-to-error-cannot-import-name-dataerror – Ftagliacarne Feb 01 '23 at 12:16
  • In any case, it seems like there might be an issue between pandas profiling and python3.11. https://github.com/ydataai/ydata-profiling/issues/1237 – Ftagliacarne Feb 01 '23 at 12:17

1 Answers1

0

From the error i can guess you have some environment issues. The code you have written is errorless. Run your code in colab and you should see the results.

  • No i have already added the environment variables , each service updated. But i am unable to resolve this issue. – Saeed Feb 01 '23 at 09:28