1

I generated an interactive output file using the auto visualization tool - 'Pandas Profiling'. There's a sentence at the bottom of the page that I want to remove.

Output file with the footer

This is my report generation code -->


def pand_prof_fun(eda_file, savepath):                                  
    
    profile = ProfileReport(eda_file)                                   

    # Activating the widgets
    profile.to_widgets()
    profile.to_notebook_iframe()

    # Saving & generating the report
    pp.ProfileReport(eda_file)
    profile.to_file(savepath)
    profile = ProfileReport(eda_file, title="My Data Profile Report")
    
    return profile

The output gets stored in a file that is in HTML format, but the HTML code cannot be accessed. Is there a way to remove the footer from the file?

Apoorva
  • 75
  • 6
  • 1
    What does the documentation say? If it is open source, did you look at the code that generates the *report* to see if it can be modified? Why can't you access the html? – wwii Dec 14 '22 at 19:55
  • It is open source. Using the 'Inspect' option lets us see the code. The footer element can be hidden using the 'Hide Element' option upon right-clicking. But it is temporary. Once the page is refreshed, the hidden elements get uncovered again. I'm sending my code through an API. So I want to know if there's any possibility to include the removal of the footer through my code. – Apoorva Dec 15 '22 at 10:08
  • I rooted around in the source on github and it looks like there are a couple of places that the footer might be removed - I searched the repository for `'generated by'` then followed *links* where those things are used. Didn't spend enough time to figure it al out but looks promising as long as your willing to modify your install. – wwii Dec 15 '22 at 14:50
  • Thanks for the responses. I used scraping to replace the text. It worked. – Apoorva Dec 19 '22 at 08:31

1 Answers1

1

I modified it by going to the source code, here what I did:

Í went to my conda environment, then to : \Lib\site-packages\pandas_profiling\report\structure\report.py

There you will find a footer, in the report.py, modified this line:

footer = HTML( content='Report generated by YData .' )

Then go the __pycache__ folder, in the structure folder, delete all the cache files, restart your application.

Paulo
  • 319
  • 1
  • 3
  • 12