I am using the pandas profiling library to generate reports for my DataFrame. However, I would like to customize the report to include the 90th percentile value in the statistics section. I tried modifying the profile.description_set['variables']['orgcount']['quantiles'] attribute as mentioned in the documentation, but the 90th percentile value is not displayed in the report.
Here's the code snippet I tried:
import pandas as pd
from pandas_profiling import ProfileReport
# Create a sample DataFrame
data = {'orgcount': [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]}
df = pd.DataFrame(data)
# Generate the profile report
profile = ProfileReport(df)
# Customize the column statistics
profile.description_set['variables']['orgcount']['quantiles'] = {
'q90': {'name': '90th percentile', 'value': lambda x: x.quantile(0.9)}
}
# Display the modified profile report
profile.to_widgets()
The above code does not show the 90th percentile value in the report. How can I customize the pandas profiling report to display the 90th percentile value? Am I missing something in the customization process?
Any help or guidance would be greatly appreciated. Thank you!