-1

When I'm trying to do data profiling one sql server table by using pandas_profiling throwing an error like

An attempt has been made to start a new process before the current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

This is the code which I'm using to run,I couldn't figure out how to resolve this issue.

import pandas as pd
import pandas_profiling


df=pd.DataFrame(read)
profile=pandas_profiling.ProfileReport(df)

enter code here

I expect to see a profiling result of a given table:

enter image description here

Simon
  • 5,464
  • 6
  • 49
  • 85

1 Answers1

1

try using multiprocessing.freeze_support() as below:

import multiprocessing
import numpy as np
import pandas as pd
import pandas_profiling


def test_profile():
    df = pd.DataFrame(
        np.random.rand(100, 5),
        columns=['a', 'b', 'c', 'd', 'e']
    )

    profile = pandas_profiling.ProfileReport(df)
    profile.to_file(outputfile="output.html")


if __name__ == '__main__':
    multiprocessing.freeze_support()
    test_profile()
Omar Nour
  • 31
  • 1
  • 5