Experts,
Here is my block of code and I am getting the below error.
import pandas
import os
trainFile = r'C:\PythonProjects\sample.csv'
pwd = os.getcwd()
os.chdir(os.path.dirname(trainFile))
trainData = pandas.read_csv(os.path.basename(trainFile))
p=pandas_profiling.ProfileReport(trainData)
os.chdir(pwd)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) in () 6 trainData = pandas.read_csv(os.path.basename(trainFile)) ----> 7 p=pandas_profiling.ProfileReport(trainData) 8 os.chdir(pwd)
Can you provide your inputs/suggestions to resolve this error pls. NameError: name 'pandas_profiling' is not defined
Remember to run import pandas_profiling
before using it.
This should work for those who want to use the latest version:
pip uninstall pandas_profiling
or conda uninstall pandas_profiling
from anaconda prompt/command promptpip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zip
If you're using something like a Jupyter Notebook/Jupyter Lab, be sure to restart your kernel and re-import your packages.
I hope this helps.