Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jupyter-naas
GitHub Repository: jupyter-naas/awesome-notebooks
Path: blob/master/Advertools/Advertools_Visualize_status_codes_count.ipynb
2973 views
Kernel: Python 3

Advertools.png

Advertools - Visualize status codes count

Give Feedback | Bug report

Tags: #advertools #adviz #status_code #asset #plotly #naas

Author: Elias Dabbas

Last update: 2023-07-20 (Created: 2023-07-20)

Description: This notebook creates a chat to visualize status code count.

References:

Input

Import libraries

try: import adviz except ModuleNotFoundError: !pip install adviz --user import adviz import naas

Setup Variables

  • name: The name of the column that you want displayed in the final table. It appears in the caption and defaults to "data".

  • size: The size in points of the font of the table. This results in the whole table being resized.

  • status_code_list: This is a list that contains different status codes. These are HTTP status codes which are standard response codes given by web site servers on the internet. The codes help identify the cause of the problem when a web page or other resource does not load properly.

  • html_path: This is a string variable that stores the path where the HTML output will be saved.

# Inputs name = 'Status codes' size = 14 status_code_list = [ 200, 400, 201, 401, 405, 503 ] # Outputs html_path = "status_code_count.html"

Model

Visualize status codes OK and KO

fig = adviz.value_counts_plus( status_code_list, name=name, size=size ) fig

Output

Export fig to HTML

fig.to_html(html_path)

Share asset with naas

You have the capability to distribute this chart using the provided public URL

naas.asset.add(html_path, params={"inline": True})