Skip to content

Instantly share code, notes, and snippets.

@neon-ninja
Created September 20, 2023 23:07
Show Gist options
  • Save neon-ninja/ecbae65b51f1aacdcb984ec6b6acc633 to your computer and use it in GitHub Desktop.
Save neon-ninja/ecbae65b51f1aacdcb984ec6b6acc633 to your computer and use it in GitHub Desktop.
scrape ASA
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyP3xfd/Ib50P9IxhvfAGV6O",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"893c009ce31049b5aea7e343a1ef9075": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_6a4c137d88ad4a0d8af1246b1241cf21",
"IPY_MODEL_ef0a528112cf4947969c8eab72eeab47",
"IPY_MODEL_94bb06a9eff3452aa126cc3de831707f"
],
"layout": "IPY_MODEL_e35dbf8644e9484380dbcbd61d795825"
}
},
"6a4c137d88ad4a0d8af1246b1241cf21": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_dd5bbddca7274457bf7a6c45780fc994",
"placeholder": "​",
"style": "IPY_MODEL_1d4a5d1d3aa74bbbab3eacd5d267ea1e",
"value": "100%"
}
},
"ef0a528112cf4947969c8eab72eeab47": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_e2fb2d0d01f04142b8a966a3d7991ff3",
"max": 42,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_60054a99802c47fd9db58fc876cb7b05",
"value": 42
}
},
"94bb06a9eff3452aa126cc3de831707f": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_699e8f08506b4ed2b7c479fdd2245747",
"placeholder": "​",
"style": "IPY_MODEL_d0b6ef136b63488c9a207826e22a5367",
"value": " 42/42 [00:00<00:00, 208.19it/s]"
}
},
"e35dbf8644e9484380dbcbd61d795825": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"dd5bbddca7274457bf7a6c45780fc994": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"1d4a5d1d3aa74bbbab3eacd5d267ea1e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"e2fb2d0d01f04142b8a966a3d7991ff3": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"60054a99802c47fd9db58fc876cb7b05": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"699e8f08506b4ed2b7c479fdd2245747": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"d0b6ef136b63488c9a207826e22a5367": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"52ffaa29a11e4cc9a0352b0556b055b4": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_c75d283155874f2fbb8d12ff8aae3da3",
"IPY_MODEL_3f641bd7af524c799770bb85dcba5dbe",
"IPY_MODEL_3f7109c62c5f467ab9124b1747d49cf0"
],
"layout": "IPY_MODEL_1bfe6868c8a44458b13a862cbbe83295"
}
},
"c75d283155874f2fbb8d12ff8aae3da3": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_bea1ebdfc10e41d1a99d6c0f414915b8",
"placeholder": "​",
"style": "IPY_MODEL_5dee680bd2d149b3b9be2a125a22f39e",
"value": "100%"
}
},
"3f641bd7af524c799770bb85dcba5dbe": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_b7c4e9e058f44304bbb91d890582d52d",
"max": 7,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_423fa928e8d54a9b80f8211a66110421",
"value": 7
}
},
"3f7109c62c5f467ab9124b1747d49cf0": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_863bb28b16844ee6b49c6b83c822ca56",
"placeholder": "​",
"style": "IPY_MODEL_607e01a8b184492591b61988e3d0ca23",
"value": " 7/7 [00:00<00:00, 8.76it/s]"
}
},
"1bfe6868c8a44458b13a862cbbe83295": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"bea1ebdfc10e41d1a99d6c0f414915b8": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"5dee680bd2d149b3b9be2a125a22f39e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"b7c4e9e058f44304bbb91d890582d52d": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"423fa928e8d54a9b80f8211a66110421": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"863bb28b16844ee6b49c6b83c822ca56": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"607e01a8b184492591b61988e3d0ca23": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"58b562a8996a400781a1fcc46cc3ac29": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_5da788827035415f8e57d8ebc536917f",
"IPY_MODEL_214208adda8c479aa2ee3c14ab21570b",
"IPY_MODEL_149046fd000047a08fb8b8ce0f77a894"
],
"layout": "IPY_MODEL_3a842e2871784b22ba35b9423a42f12c"
}
},
"5da788827035415f8e57d8ebc536917f": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_bc21c41aedd24153a30d91a506e0986f",
"placeholder": "​",
"style": "IPY_MODEL_881956abef02439bb16fba2612cdf6c1",
"value": "100%"
}
},
"214208adda8c479aa2ee3c14ab21570b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_ecaf75a0fa384255ba682eabd5d1d487",
"max": 13,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_e17efd80f9ff47e28b1c6faaa8b98aee",
"value": 13
}
},
"149046fd000047a08fb8b8ce0f77a894": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_a78480df4d7a4b0088f29a756baff5c3",
"placeholder": "​",
"style": "IPY_MODEL_e26d2eb549824fa0bdb6f9a83a4de7c0",
"value": " 13/13 [00:00<00:00, 63.78it/s]"
}
},
"3a842e2871784b22ba35b9423a42f12c": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"bc21c41aedd24153a30d91a506e0986f": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"881956abef02439bb16fba2612cdf6c1": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"ecaf75a0fa384255ba682eabd5d1d487": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"e17efd80f9ff47e28b1c6faaa8b98aee": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"a78480df4d7a4b0088f29a756baff5c3": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"e26d2eb549824fa0bdb6f9a83a4de7c0": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"a5918099b4d542589c736cc9f8daa5ff": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_5dcde7f8a4e04c659d609fcefc913999",
"IPY_MODEL_6daeab02faee4f03b431b2757ef03495",
"IPY_MODEL_20388cf5a6404fb985714db0c275d5c3"
],
"layout": "IPY_MODEL_d0bfa401a37448d796d764b31411e2db"
}
},
"5dcde7f8a4e04c659d609fcefc913999": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_366dc061ded54696b848344bf80cd11f",
"placeholder": "​",
"style": "IPY_MODEL_3eced34cce2a4170af09563c90d4a6ff",
"value": "100%"
}
},
"6daeab02faee4f03b431b2757ef03495": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_f8ffc9633ec946f6b48c73bf939771c1",
"max": 18,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_501b420cba3c46bc872c6da84f9e1604",
"value": 18
}
},
"20388cf5a6404fb985714db0c275d5c3": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_ad2b47f246954712970181feb0eb34c9",
"placeholder": "​",
"style": "IPY_MODEL_212aa1db0a3f4e66bd3ae5d4726df083",
"value": " 18/18 [00:00<00:00, 56.65it/s]"
}
},
"d0bfa401a37448d796d764b31411e2db": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"366dc061ded54696b848344bf80cd11f": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"3eced34cce2a4170af09563c90d4a6ff": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"f8ffc9633ec946f6b48c73bf939771c1": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"501b420cba3c46bc872c6da84f9e1604": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"ad2b47f246954712970181feb0eb34c9": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"212aa1db0a3f4e66bd3ae5d4726df083": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
}
}
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/neon-ninja/ecbae65b51f1aacdcb984ec6b6acc633/scrape-asa.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 212,
"metadata": {
"id": "995BgTrpSI2p",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "8a0a5733-5191-4c71-f431-a830f9f6b680"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: requests-cache in /usr/local/lib/python3.10/dist-packages (1.1.0)\n",
"Requirement already satisfied: attrs>=21.2 in /usr/local/lib/python3.10/dist-packages (from requests-cache) (23.1.0)\n",
"Requirement already satisfied: cattrs>=22.2 in /usr/local/lib/python3.10/dist-packages (from requests-cache) (23.1.2)\n",
"Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests-cache) (3.10.0)\n",
"Requirement already satisfied: requests>=2.22 in /usr/local/lib/python3.10/dist-packages (from requests-cache) (2.31.0)\n",
"Requirement already satisfied: url-normalize>=1.4 in /usr/local/lib/python3.10/dist-packages (from requests-cache) (1.4.3)\n",
"Requirement already satisfied: urllib3>=1.25.5 in /usr/local/lib/python3.10/dist-packages (from requests-cache) (2.0.4)\n",
"Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from cattrs>=22.2->requests-cache) (1.1.3)\n",
"Requirement already satisfied: typing_extensions>=4.1.0 in /usr/local/lib/python3.10/dist-packages (from cattrs>=22.2->requests-cache) (4.5.0)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.22->requests-cache) (3.2.0)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.22->requests-cache) (3.4)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.22->requests-cache) (2023.7.22)\n",
"Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from url-normalize>=1.4->requests-cache) (1.16.0)\n"
]
}
],
"source": [
"!pip install requests-cache\n",
"import requests\n",
"import requests_cache\n",
"requests_cache.install_cache('requests_cache')\n",
"import pandas as pd\n",
"from bs4 import BeautifulSoup\n",
"from tqdm.auto import tqdm\n",
"from pprint import pprint"
]
},
{
"cell_type": "code",
"source": [
"# Get mediums\n",
"soup = BeautifulSoup(requests.get(\"https://www.asa.co.nz/decisions/search-browse-decisions/\").text)\n",
"inputs = soup.find_all(\"div\", class_=\"checkbox\")\n",
"mediums = []\n",
"for input in inputs:\n",
" mediums.append({\n",
" \"name\": input.text.strip(),\n",
" \"value\": input.find(\"input\").attrs[\"value\"],\n",
" \"isparent\": bool(input.find(\"input\").attrs.get(\"onclick\"))\n",
" })\n",
"mediums = pd.json_normalize(mediums)\n",
"mediums"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"id": "Bg2Pfz5aXKMb",
"outputId": "b62f75a3-0807-4ac9-a7e0-d55389828712"
},
"execution_count": 213,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" name value isparent\n",
"0 Digital Marketing 1 True\n",
"1 Display 3 False\n",
"2 Paid Search 5 False\n",
"3 Social Media 7 False\n",
"4 Advertiser Website 2 False\n",
"5 In-Game 4 False\n",
"6 SMS/MMS 6 False\n",
"7 Other 8 False\n",
"8 Addressed Mail 9 True\n",
"9 Catalogue 11 False\n",
"10 Letter 14 False\n",
"11 Brochure 10 False\n",
"12 Email 12 False\n",
"13 Other 15 False\n",
"14 Out of Home 16 True\n",
"15 Digital Display 18 False\n",
"16 Point of Sale 20 False\n",
"17 Vehicle 22 False\n",
"18 Other 24 False\n",
"19 Billboard 17 False\n",
"20 In-Store 19 False\n",
"21 Poster 21 False\n",
"22 Window Display 23 False\n",
"23 Print 25 True\n",
"24 Directory 27 False\n",
"25 Magazine 29 False\n",
"26 Other 31 False\n",
"27 Community Newspaper 26 False\n",
"28 Insert 28 False\n",
"29 Newspaper 30 False\n",
"30 Unaddressed Mail 35 True\n",
"31 Catalogue 37 False\n",
"32 Fax 39 False\n",
"33 Other 41 False\n",
"34 Brochure 36 False\n",
"35 Email 38 False\n",
"36 Letter 40 False\n",
"37 Live Television 33 False\n",
"38 On Demand 43 False\n",
"39 Radio 32 False\n",
"40 Cinema 34 False\n",
"41 Other 42 False"
],
"text/html": [
"\n",
" <div id=\"df-c9bcc777-e164-4205-8ffc-f8ead9a0880a\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>name</th>\n",
" <th>value</th>\n",
" <th>isparent</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Digital Marketing</td>\n",
" <td>1</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Display</td>\n",
" <td>3</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Paid Search</td>\n",
" <td>5</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Social Media</td>\n",
" <td>7</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Advertiser Website</td>\n",
" <td>2</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>In-Game</td>\n",
" <td>4</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>SMS/MMS</td>\n",
" <td>6</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Other</td>\n",
" <td>8</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Addressed Mail</td>\n",
" <td>9</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Catalogue</td>\n",
" <td>11</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Letter</td>\n",
" <td>14</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Brochure</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Email</td>\n",
" <td>12</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Other</td>\n",
" <td>15</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>Out of Home</td>\n",
" <td>16</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>Digital Display</td>\n",
" <td>18</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>Point of Sale</td>\n",
" <td>20</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>Vehicle</td>\n",
" <td>22</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>Other</td>\n",
" <td>24</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>Billboard</td>\n",
" <td>17</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>In-Store</td>\n",
" <td>19</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>Poster</td>\n",
" <td>21</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>Window Display</td>\n",
" <td>23</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>Print</td>\n",
" <td>25</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>Directory</td>\n",
" <td>27</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>Magazine</td>\n",
" <td>29</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>Other</td>\n",
" <td>31</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>Community Newspaper</td>\n",
" <td>26</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>Insert</td>\n",
" <td>28</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>Newspaper</td>\n",
" <td>30</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>Unaddressed Mail</td>\n",
" <td>35</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>Catalogue</td>\n",
" <td>37</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>Fax</td>\n",
" <td>39</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>Other</td>\n",
" <td>41</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>Brochure</td>\n",
" <td>36</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>Email</td>\n",
" <td>38</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>Letter</td>\n",
" <td>40</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>Live Television</td>\n",
" <td>33</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>On Demand</td>\n",
" <td>43</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>Radio</td>\n",
" <td>32</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>40</th>\n",
" <td>Cinema</td>\n",
" <td>34</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>Other</td>\n",
" <td>42</td>\n",
" <td>False</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-c9bcc777-e164-4205-8ffc-f8ead9a0880a')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-c9bcc777-e164-4205-8ffc-f8ead9a0880a button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-c9bcc777-e164-4205-8ffc-f8ead9a0880a');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-fad51e12-22af-4495-8049-f03773853bf4\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-fad51e12-22af-4495-8049-f03773853bf4')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-fad51e12-22af-4495-8049-f03773853bf4 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 213
}
]
},
{
"cell_type": "code",
"source": [
"# Get rulings\n",
"def get_options(id=\"ruling\"):\n",
" options = soup.find(\"select\", id=id).find_all(\"option\")\n",
" results = []\n",
" for option in options:\n",
" if option.text.strip():\n",
" results.append({\n",
" \"name\": option.text.strip(),\n",
" \"value\": option.attrs[\"value\"]\n",
" })\n",
" result_df = pd.json_normalize(results)\n",
" return result_df\n",
"\n",
"rulings = get_options()\n",
"rulings"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 269
},
"id": "BVxw7poZSU-A",
"outputId": "112c6016-c938-4fc8-fa6e-dcb1bfe1b3b8"
},
"execution_count": 214,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" name value\n",
"0 No Grounds to Proceed 1\n",
"1 Withdrawn / Resolved 2\n",
"2 Upheld / Settled 3\n",
"3 Not Upheld 4\n",
"4 No Jurisdiction 5\n",
"5 Decline to Adjudicate 6\n",
"6 No Further Action 7"
],
"text/html": [
"\n",
" <div id=\"df-e1cd4613-d6b1-4f70-904b-121927af0fae\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>name</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Withdrawn / Resolved</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Upheld / Settled</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Not Upheld</td>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>No Jurisdiction</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Decline to Adjudicate</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>No Further Action</td>\n",
" <td>7</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-e1cd4613-d6b1-4f70-904b-121927af0fae')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-e1cd4613-d6b1-4f70-904b-121927af0fae button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-e1cd4613-d6b1-4f70-904b-121927af0fae');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-39152bed-7efb-4957-9bea-fc51daf4b5c8\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-39152bed-7efb-4957-9bea-fc51daf4b5c8')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-39152bed-7efb-4957-9bea-fc51daf4b5c8 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 214
}
]
},
{
"cell_type": "code",
"source": [
"products = get_options(\"product\")\n",
"products"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 457
},
"id": "ie50yOHxTzEb",
"outputId": "8f705e21-24bd-4e6c-d2c3-6102f242f95d"
},
"execution_count": 215,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" name value\n",
"0 Advocacy 1\n",
"1 Alcohol 2\n",
"2 Apparel 3\n",
"3 Electronic and ICT 4\n",
"4 Entertainment 5\n",
"5 Finance 6\n",
"6 Food and Beverage 7\n",
"7 Household Goods 9\n",
"8 Services 10\n",
"9 Telecommunications 11\n",
"10 Therapeutics and Health 8\n",
"11 Vehicles / Transportation 12\n",
"12 Other 13"
],
"text/html": [
"\n",
" <div id=\"df-f259c401-a7c2-47c2-aa59-7539f3437d06\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>name</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Advocacy</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Alcohol</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Apparel</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Electronic and ICT</td>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Entertainment</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Finance</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Food and Beverage</td>\n",
" <td>7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Household Goods</td>\n",
" <td>9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Services</td>\n",
" <td>10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Telecommunications</td>\n",
" <td>11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Therapeutics and Health</td>\n",
" <td>8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Vehicles / Transportation</td>\n",
" <td>12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Other</td>\n",
" <td>13</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f259c401-a7c2-47c2-aa59-7539f3437d06')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-f259c401-a7c2-47c2-aa59-7539f3437d06 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-f259c401-a7c2-47c2-aa59-7539f3437d06');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-7ac2b0ca-b7b7-472e-af69-0e544af147c4\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-7ac2b0ca-b7b7-472e-af69-0e544af147c4')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-7ac2b0ca-b7b7-472e-af69-0e544af147c4 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 215
}
]
},
{
"cell_type": "code",
"source": [
"codes = get_options(\"code\").drop_duplicates(subset=\"value\")\n",
"codes"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 614
},
"id": "KAr7bJdWUIE0",
"outputId": "a915bbd4-d1de-48c1-9750-cd4ad37b78f7"
},
"execution_count": 216,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" name value\n",
"0 Advertising Standards Code 301\n",
"1 Alcohol Advertising and Promotion Code 322\n",
"2 Children and Young People's Advertising Code 265\n",
"3 Financial Advertising Code 3\n",
"4 Gambling Advertising Code 11\n",
"5 Therapeutic and Health Advertising Code 264\n",
"6 Children's Code for Advertising Food 18\n",
"7 Code for Advertising and Promotion of Alcohol 20\n",
"8 Code for Advertising Food 19\n",
"9 Code for Advertising of Weight Management 5\n",
"10 Code for Advertising to Children 17\n",
"11 Code for Advertising Vehicles 12\n",
"12 Code for Comparative Advertising 21\n",
"13 Code for Environmental Claims 22\n",
"15 Code for People in Advertising 4\n",
"16 Code of Ethics 1\n",
"17 Therapeutic Products Advertising Code 14\n",
"18 Therapeutic Services Advertising Code 13"
],
"text/html": [
"\n",
" <div id=\"df-bf14a607-6092-47d4-9879-ec89b92b76c6\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>name</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Advertising Standards Code</td>\n",
" <td>301</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Alcohol Advertising and Promotion Code</td>\n",
" <td>322</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Children and Young People's Advertising Code</td>\n",
" <td>265</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Financial Advertising Code</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Gambling Advertising Code</td>\n",
" <td>11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Therapeutic and Health Advertising Code</td>\n",
" <td>264</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Children's Code for Advertising Food</td>\n",
" <td>18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Code for Advertising and Promotion of Alcohol</td>\n",
" <td>20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Code for Advertising Food</td>\n",
" <td>19</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Code for Advertising of Weight Management</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Code for Advertising to Children</td>\n",
" <td>17</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Code for Advertising Vehicles</td>\n",
" <td>12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Code for Comparative Advertising</td>\n",
" <td>21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Code for Environmental Claims</td>\n",
" <td>22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>Code for People in Advertising</td>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>Code of Ethics</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>Therapeutic Products Advertising Code</td>\n",
" <td>14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>Therapeutic Services Advertising Code</td>\n",
" <td>13</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-bf14a607-6092-47d4-9879-ec89b92b76c6')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-bf14a607-6092-47d4-9879-ec89b92b76c6 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-bf14a607-6092-47d4-9879-ec89b92b76c6');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-f9c456ef-a7b4-4b36-90c1-daf4ff619ea3\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-f9c456ef-a7b4-4b36-90c1-daf4ff619ea3')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-f9c456ef-a7b4-4b36-90c1-daf4ff619ea3 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 216
}
]
},
{
"cell_type": "code",
"source": [
"# For each medium, get all decisions within the medium\n",
"# Tag each decision with their medium\n",
"URL = \"https://www.asa.co.nz/backend/documentsearch.php\"\n",
"def fetch_faceted(facet_df=mediums, key=\"media\"):\n",
" results = []\n",
" for i, row in tqdm(facet_df.iterrows(), total=len(facet_df)):\n",
" facet_name = row[\"name\"]\n",
" facet_id = row[\"value\"]\n",
" for i in range(30):\n",
" r = requests.get(URL, params={\n",
" \"page\": i,\n",
" key: facet_id\n",
" }).json()\n",
" for result in r:\n",
" result[key] = facet_name\n",
" results.extend(r)\n",
" # Page limit is 150, so if there's less than 150 results, this is the last page\n",
" if len(r) < 150:\n",
" break\n",
" return pd.DataFrame(results)\n",
"df = fetch_faceted()\n",
"df"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 629,
"referenced_widgets": [
"893c009ce31049b5aea7e343a1ef9075",
"6a4c137d88ad4a0d8af1246b1241cf21",
"ef0a528112cf4947969c8eab72eeab47",
"94bb06a9eff3452aa126cc3de831707f",
"e35dbf8644e9484380dbcbd61d795825",
"dd5bbddca7274457bf7a6c45780fc994",
"1d4a5d1d3aa74bbbab3eacd5d267ea1e",
"e2fb2d0d01f04142b8a966a3d7991ff3",
"60054a99802c47fd9db58fc876cb7b05",
"699e8f08506b4ed2b7c479fdd2245747",
"d0b6ef136b63488c9a207826e22a5367"
]
},
"id": "m8OCEaTrYpCC",
"outputId": "c5191fd0-1cfe-4d0f-9566-b332604d2ae7"
},
"execution_count": 217,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
" 0%| | 0/42 [00:00<?, ?it/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "893c009ce31049b5aea7e343a1ef9075"
}
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"0 1391 17/279 Inspector Spot, Digital Marketing \n",
"1 617 Complaint 15/128 eGentics, Kiwi Rewards email ... \n",
"2 782 Complaint 15/205 Life Energy Designs, Website ... \n",
"3 383 Complaint 16/185 The Mix – On Demand\\t \n",
"4 678 Complaint 16/334 Kiwibank Ltd, Addressed Mail,... \n",
"... ... ... \n",
"4034 1713 Complaint 18/161 Tilt Renewables Viewing Platf... \n",
"4035 1837 Complaint 18/277 Garage Project Chocolate Beer... \n",
"4036 1931 Complaint 18/382 Lamont Wines, Packaging \n",
"4037 3566 Complaint 21/396 BurgerFuel, Player of the Day... \n",
"4038 3770 Complaint 22/097 Greenhill Beverages, Greenhil... \n",
"\n",
" summary date \\\n",
"0 The Complainant said the advertisement was mis... 2017-10-12 \n",
"1 Complainant C. Hayward felt the advertisement ... 2015-08-25 \n",
"2 Complainant M. Honeychurch said the efficacy o... 2015-11-04 \n",
"3 Complainant H. Topham said the advertisement s... 2016-06-15 \n",
"4 Complainant, S Astonn, said: “Email states 1 i... 2016-09-22 \n",
"... ... ... \n",
"4034 The Complainant was of the view the informati... 2018-06-18 \n",
"4035 The Complainant is concerned that the packagin... 2018-09-25 \n",
"4036 The Complainant was concerned the product name... 2018-12-04 \n",
"4037 The Complainant was concerned the advertisemen... 2021-11-23 \n",
"4038 The Complainant was concerned the images on th... 2022-06-01 \n",
"\n",
" filename page url \\\n",
"0 17279.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/1... \n",
"1 15128.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2 15205.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/1... \n",
"3 16185.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/0... \n",
"4 16334.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/0... \n",
"... ... ... ... \n",
"4034 18161.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/0... \n",
"4035 18277.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/0... \n",
"4036 18382.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/1... \n",
"4037 21396.pdf 0 https://cdn.asa.co.nz/backend/documents/2021/1... \n",
"4038 22097.pdf 0 https://cdn.asa.co.nz/backend/documents/2022/0... \n",
"\n",
" media \n",
"0 Digital Marketing \n",
"1 Digital Marketing \n",
"2 Digital Marketing \n",
"3 Digital Marketing \n",
"4 Digital Marketing \n",
"... ... \n",
"4034 Other \n",
"4035 Other \n",
"4036 Other \n",
"4037 Other \n",
"4038 Other \n",
"\n",
"[4039 rows x 8 columns]"
],
"text/html": [
"\n",
" <div id=\"df-0a6a284b-a988-4f89-8975-efd197b133f7\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>media</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1391</td>\n",
" <td>17/279 Inspector Spot, Digital Marketing</td>\n",
" <td>The Complainant said the advertisement was mis...</td>\n",
" <td>2017-10-12</td>\n",
" <td>17279.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/1...</td>\n",
" <td>Digital Marketing</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>617</td>\n",
" <td>Complaint 15/128 eGentics, Kiwi Rewards email ...</td>\n",
" <td>Complainant C. Hayward felt the advertisement ...</td>\n",
" <td>2015-08-25</td>\n",
" <td>15128.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Digital Marketing</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>782</td>\n",
" <td>Complaint 15/205 Life Energy Designs, Website ...</td>\n",
" <td>Complainant M. Honeychurch said the efficacy o...</td>\n",
" <td>2015-11-04</td>\n",
" <td>15205.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/1...</td>\n",
" <td>Digital Marketing</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>383</td>\n",
" <td>Complaint 16/185 The Mix – On Demand\\t</td>\n",
" <td>Complainant H. Topham said the advertisement s...</td>\n",
" <td>2016-06-15</td>\n",
" <td>16185.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/0...</td>\n",
" <td>Digital Marketing</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>678</td>\n",
" <td>Complaint 16/334 Kiwibank Ltd, Addressed Mail,...</td>\n",
" <td>Complainant, S Astonn, said: “Email states 1 i...</td>\n",
" <td>2016-09-22</td>\n",
" <td>16334.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/0...</td>\n",
" <td>Digital Marketing</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4034</th>\n",
" <td>1713</td>\n",
" <td>Complaint 18/161 Tilt Renewables Viewing Platf...</td>\n",
" <td>The Complainant was of the view the informati...</td>\n",
" <td>2018-06-18</td>\n",
" <td>18161.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/0...</td>\n",
" <td>Other</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4035</th>\n",
" <td>1837</td>\n",
" <td>Complaint 18/277 Garage Project Chocolate Beer...</td>\n",
" <td>The Complainant is concerned that the packagin...</td>\n",
" <td>2018-09-25</td>\n",
" <td>18277.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/0...</td>\n",
" <td>Other</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4036</th>\n",
" <td>1931</td>\n",
" <td>Complaint 18/382 Lamont Wines, Packaging</td>\n",
" <td>The Complainant was concerned the product name...</td>\n",
" <td>2018-12-04</td>\n",
" <td>18382.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/1...</td>\n",
" <td>Other</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4037</th>\n",
" <td>3566</td>\n",
" <td>Complaint 21/396 BurgerFuel, Player of the Day...</td>\n",
" <td>The Complainant was concerned the advertisemen...</td>\n",
" <td>2021-11-23</td>\n",
" <td>21396.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2021/1...</td>\n",
" <td>Other</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4038</th>\n",
" <td>3770</td>\n",
" <td>Complaint 22/097 Greenhill Beverages, Greenhil...</td>\n",
" <td>The Complainant was concerned the images on th...</td>\n",
" <td>2022-06-01</td>\n",
" <td>22097.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2022/0...</td>\n",
" <td>Other</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4039 rows × 8 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-0a6a284b-a988-4f89-8975-efd197b133f7')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-0a6a284b-a988-4f89-8975-efd197b133f7 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-0a6a284b-a988-4f89-8975-efd197b133f7');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-1486cadc-139f-4d53-ab60-2beb1b972b13\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-1486cadc-139f-4d53-ab60-2beb1b972b13')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-1486cadc-139f-4d53-ab60-2beb1b972b13 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 217
}
]
},
{
"cell_type": "code",
"source": [
"df.media.value_counts()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "k_B9REEZUPYM",
"outputId": "673f62e7-6019-4ef9-83fe-69121352de17"
},
"execution_count": 218,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"Live Television 1561\n",
"Advertiser Website 670\n",
"Social Media 391\n",
"Radio 256\n",
"Digital Marketing 221\n",
"Billboard 163\n",
"Newspaper 108\n",
"Print 101\n",
"Out of Home 98\n",
"Other 63\n",
"Brochure 62\n",
"Poster 60\n",
"Unaddressed Mail 54\n",
"Email 45\n",
"In-Store 35\n",
"Vehicle 30\n",
"Display 22\n",
"Addressed Mail 21\n",
"Paid Search 12\n",
"Magazine 11\n",
"Community Newspaper 11\n",
"Catalogue 9\n",
"On Demand 7\n",
"Window Display 6\n",
"Cinema 4\n",
"Insert 3\n",
"Digital Display 3\n",
"Letter 3\n",
"SMS/MMS 3\n",
"In-Game 3\n",
"Point of Sale 3\n",
"Name: media, dtype: int64"
]
},
"metadata": {},
"execution_count": 218
}
]
},
{
"cell_type": "code",
"source": [
"by_ruling = fetch_faceted(rulings, key=\"ruling\")\n",
"by_ruling"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 629,
"referenced_widgets": [
"52ffaa29a11e4cc9a0352b0556b055b4",
"c75d283155874f2fbb8d12ff8aae3da3",
"3f641bd7af524c799770bb85dcba5dbe",
"3f7109c62c5f467ab9124b1747d49cf0",
"1bfe6868c8a44458b13a862cbbe83295",
"bea1ebdfc10e41d1a99d6c0f414915b8",
"5dee680bd2d149b3b9be2a125a22f39e",
"b7c4e9e058f44304bbb91d890582d52d",
"423fa928e8d54a9b80f8211a66110421",
"863bb28b16844ee6b49c6b83c822ca56",
"607e01a8b184492591b61988e3d0ca23"
]
},
"id": "T7M8Ei5bURxi",
"outputId": "b06c76e7-8559-4d58-d3c2-694d85c36df1"
},
"execution_count": 219,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
" 0%| | 0/7 [00:00<?, ?it/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "52ffaa29a11e4cc9a0352b0556b055b4"
}
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"0 3529 \n",
"1 1113 17/064 Briscoes Group Ltd Rebel Sport Television \n",
"2 1220 17/161 Fluoride Free NZ, Television \n",
"3 1268 17/201 SKY Television, Television \n",
"4 1283 17/224 Foodstuffs, Radio \n",
"... ... ... \n",
"4042 4216 Complaint 23/239 Hobson's Pledge Trust, Digita... \n",
"4043 4214 Complaint 23/241 NZ National Party, Digital Ma... \n",
"4044 4218 Complaint 23/242 New Zealand First, Out of Home \n",
"4045 4219 Complaint 23/243 ACT Party, Out of Home \n",
"4046 4217 Complaint 23/245 NZ National Party, Out of Home \n",
"\n",
" summary date \\\n",
"0 2021-11-08 \n",
"1 Complainant, L MacKinnon, said the ad refers t... 2017-03-08 \n",
"2 The Complainant’s concerns were that the adver... 2017-06-09 \n",
"3 The Chair acknowledged the Complainant’s conce... 2017-07-17 \n",
"4 The Complainant’s concern was that the Maori l... 2017-07-26 \n",
"... ... ... \n",
"4042 The relevant codes are Advertising Standards C... 2023-09-18 \n",
"4043 The relevant codes are Advertising Standards C... 2023-09-19 \n",
"4044 The relevant codes are Advertising Standards C... 2023-09-19 \n",
"4045 The relevant codes are Advertising Standards C... 2023-09-20 \n",
"4046 The relevant codes are Advertising Standards C... 2023-09-20 \n",
"\n",
" filename page url \\\n",
"0 None 0 https://cdn.asa.co.nz/backend/documents/2021/1... \n",
"1 17064.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/0... \n",
"2 17161.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/0... \n",
"3 17201.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/0... \n",
"4 17224.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/0... \n",
"... ... ... ... \n",
"4042 23239.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"4043 23241.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"4044 23242.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"4045 23243.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"4046 23245.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"\n",
" ruling \n",
"0 No Grounds to Proceed \n",
"1 No Grounds to Proceed \n",
"2 No Grounds to Proceed \n",
"3 No Grounds to Proceed \n",
"4 No Grounds to Proceed \n",
"... ... \n",
"4042 No Further Action \n",
"4043 No Further Action \n",
"4044 No Further Action \n",
"4045 No Further Action \n",
"4046 No Further Action \n",
"\n",
"[4047 rows x 8 columns]"
],
"text/html": [
"\n",
" <div id=\"df-8b44ee29-7330-407e-b3f0-f9b0d11d4a4b\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>ruling</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>3529</td>\n",
" <td></td>\n",
" <td></td>\n",
" <td>2021-11-08</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2021/1...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1113</td>\n",
" <td>17/064 Briscoes Group Ltd Rebel Sport Television</td>\n",
" <td>Complainant, L MacKinnon, said the ad refers t...</td>\n",
" <td>2017-03-08</td>\n",
" <td>17064.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1220</td>\n",
" <td>17/161 Fluoride Free NZ, Television</td>\n",
" <td>The Complainant’s concerns were that the adver...</td>\n",
" <td>2017-06-09</td>\n",
" <td>17161.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1268</td>\n",
" <td>17/201 SKY Television, Television</td>\n",
" <td>The Chair acknowledged the Complainant’s conce...</td>\n",
" <td>2017-07-17</td>\n",
" <td>17201.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1283</td>\n",
" <td>17/224 Foodstuffs, Radio</td>\n",
" <td>The Complainant’s concern was that the Maori l...</td>\n",
" <td>2017-07-26</td>\n",
" <td>17224.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4042</th>\n",
" <td>4216</td>\n",
" <td>Complaint 23/239 Hobson's Pledge Trust, Digita...</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-18</td>\n",
" <td>23239.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4043</th>\n",
" <td>4214</td>\n",
" <td>Complaint 23/241 NZ National Party, Digital Ma...</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-19</td>\n",
" <td>23241.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4044</th>\n",
" <td>4218</td>\n",
" <td>Complaint 23/242 New Zealand First, Out of Home</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-19</td>\n",
" <td>23242.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4045</th>\n",
" <td>4219</td>\n",
" <td>Complaint 23/243 ACT Party, Out of Home</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-20</td>\n",
" <td>23243.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4046</th>\n",
" <td>4217</td>\n",
" <td>Complaint 23/245 NZ National Party, Out of Home</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-20</td>\n",
" <td>23245.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4047 rows × 8 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-8b44ee29-7330-407e-b3f0-f9b0d11d4a4b')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-8b44ee29-7330-407e-b3f0-f9b0d11d4a4b button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-8b44ee29-7330-407e-b3f0-f9b0d11d4a4b');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-f7e267a6-eb14-427d-87e1-2dc46d552386\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-f7e267a6-eb14-427d-87e1-2dc46d552386')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-f7e267a6-eb14-427d-87e1-2dc46d552386 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 219
}
]
},
{
"cell_type": "code",
"source": [
"sum(df.id.duplicated()), sum(by_ruling.id.duplicated())"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "RJelJcWUZ9BA",
"outputId": "34383eda-1db0-4879-e834-b615c99944e7"
},
"execution_count": 220,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"(0, 10)"
]
},
"metadata": {},
"execution_count": 220
}
]
},
{
"cell_type": "code",
"source": [
"by_ruling[by_ruling.id.duplicated(keep=False)].sort_values(by=\"id\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"id": "j-rCbIwOaDdz",
"outputId": "ecbfa1c2-b4cc-4887-bad5-a89acd818aa6"
},
"execution_count": 221,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"1212 2700 Complaint 20/275 NZ National Party Facebook Post \n",
"3936 2700 Complaint 20/275 NZ National Party Facebook Post \n",
"1213 2701 Complaint 20/276 NZ National Party Facebook Post \n",
"3937 2701 Complaint 20/276 NZ National Party Facebook Post \n",
"1217 2704 Complaint 20/283 Harrisons Energy Solutions Te... \n",
"3938 2704 Complaint 20/283 Harrisons Energy Solutions Te... \n",
"1231 2721 Complaint 20/314 NZ National Party Facebook Post \n",
"3940 2721 Complaint 20/314 NZ National Party Facebook Post \n",
"1232 2722 Complaint 20/315 New Zealand Labour Party Twit... \n",
"3941 2722 Complaint 20/315 New Zealand Labour Party Twit... \n",
"1209 2809 Complaint 20/271 Vote Safe, Website and Billboard \n",
"3935 2809 Complaint 20/271 Vote Safe, Website and Billboard \n",
"1311 2835 Complaint 20/446 NZ National Party MP Brett Hu... \n",
"3945 2835 Complaint 20/446 NZ National Party MP Brett Hu... \n",
"3947 2836 Complaint 20/457 Voice for Life, Defend NZ, We... \n",
"3922 2836 Complaint 20/457 Voice for Life, Defend NZ, We... \n",
"1325 2846 Complaint 20/470 Vote Safe, YouTube \n",
"3949 2846 Complaint 20/470 Vote Safe, YouTube \n",
"1329 2909 Complaint 20/479 Appeal 20/018 Safer Future Ch... \n",
"3950 2909 Complaint 20/479 Appeal 20/018 Safer Future Ch... \n",
"\n",
" summary date \\\n",
"1212 The Chair declined to adjudicate the complaint... 2020-07-05 \n",
"3936 The Chair declined to adjudicate the complaint... 2020-07-05 \n",
"1213 The Chair declined to adjudicate the complaint... 2020-07-05 \n",
"3937 The Chair declined to adjudicate the complaint... 2020-07-05 \n",
"1217 The Complainant was concerned about the refere... 2020-07-13 \n",
"3938 The Complainant was concerned about the refere... 2020-07-13 \n",
"1231 The Chair declined to adjudicate the complaint... 2020-07-23 \n",
"3940 The Chair declined to adjudicate the complaint... 2020-07-23 \n",
"1232 The Chair declined to adjudicate the complaint... 2020-07-23 \n",
"3941 The Chair declined to adjudicate the complaint... 2020-07-23 \n",
"1209 The Complainant was concerned about the billbo... 2020-08-31 \n",
"3935 The Complainant was concerned about the billbo... 2020-08-31 \n",
"1311 The Chair declined to adjudicate the complaint... 2020-09-23 \n",
"3945 The Chair declined to adjudicate the complaint... 2020-09-23 \n",
"3947 The Chair declined to adjudicate the complaint... 2020-09-25 \n",
"3922 The Chair declined to adjudicate the complaint... 2020-09-25 \n",
"1325 The Complainant was concerned the Advertiser “... 2020-09-29 \n",
"3949 The Complainant was concerned the Advertiser “... 2020-09-29 \n",
"1329 The Chair of the Complaints Board ruled on 29 ... 2020-10-15 \n",
"3950 The Chair of the Complaints Board ruled on 29 ... 2020-10-15 \n",
"\n",
" filename page \\\n",
"1212 20275.pdf 8 \n",
"3936 20275.pdf 0 \n",
"1213 20276.pdf 8 \n",
"3937 20276.pdf 0 \n",
"1217 20283.pdf 8 \n",
"3938 20283.pdf 0 \n",
"1231 20314.pdf 8 \n",
"3940 20314.pdf 0 \n",
"1232 20315.pdf 8 \n",
"3941 20315.pdf 0 \n",
"1209 20271.pdf 8 \n",
"3935 20271.pdf 0 \n",
"1311 20446.pdf 8 \n",
"3945 20446.pdf 0 \n",
"3947 20457.pdf 0 \n",
"3922 20457.pdf 0 \n",
"1325 20470.pdf 8 \n",
"3949 20470.pdf 0 \n",
"1329 Complaint 20079 Appeal 20018.pdf 8 \n",
"3950 Complaint 20079 Appeal 20018.pdf 0 \n",
"\n",
" url ruling \n",
"1212 https://cdn.asa.co.nz/backend/documents/2020/0... No Grounds to Proceed \n",
"3936 https://cdn.asa.co.nz/backend/documents/2020/0... Decline to Adjudicate \n",
"1213 https://cdn.asa.co.nz/backend/documents/2020/0... No Grounds to Proceed \n",
"3937 https://cdn.asa.co.nz/backend/documents/2020/0... Decline to Adjudicate \n",
"1217 https://cdn.asa.co.nz/backend/documents/2020/0... No Grounds to Proceed \n",
"3938 https://cdn.asa.co.nz/backend/documents/2020/0... Decline to Adjudicate \n",
"1231 https://cdn.asa.co.nz/backend/documents/2020/0... No Grounds to Proceed \n",
"3940 https://cdn.asa.co.nz/backend/documents/2020/0... Decline to Adjudicate \n",
"1232 https://cdn.asa.co.nz/backend/documents/2020/0... No Grounds to Proceed \n",
"3941 https://cdn.asa.co.nz/backend/documents/2020/0... Decline to Adjudicate \n",
"1209 https://cdn.asa.co.nz/backend/documents/2020/0... No Grounds to Proceed \n",
"3935 https://cdn.asa.co.nz/backend/documents/2020/0... Decline to Adjudicate \n",
"1311 https://cdn.asa.co.nz/backend/documents/2020/0... No Grounds to Proceed \n",
"3945 https://cdn.asa.co.nz/backend/documents/2020/0... Decline to Adjudicate \n",
"3947 https://cdn.asa.co.nz/backend/documents/2020/0... Decline to Adjudicate \n",
"3922 https://cdn.asa.co.nz/backend/documents/2020/0... No Jurisdiction \n",
"1325 https://cdn.asa.co.nz/backend/documents/2020/0... No Grounds to Proceed \n",
"3949 https://cdn.asa.co.nz/backend/documents/2020/0... Decline to Adjudicate \n",
"1329 https://cdn.asa.co.nz/backend/documents/2020/1... No Grounds to Proceed \n",
"3950 https://cdn.asa.co.nz/backend/documents/2020/1... Decline to Adjudicate "
],
"text/html": [
"\n",
" <div id=\"df-d0c89c02-2a67-4af9-bfe5-e7ee7bf27215\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>ruling</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1212</th>\n",
" <td>2700</td>\n",
" <td>Complaint 20/275 NZ National Party Facebook Post</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-07-05</td>\n",
" <td>20275.pdf</td>\n",
" <td>8</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3936</th>\n",
" <td>2700</td>\n",
" <td>Complaint 20/275 NZ National Party Facebook Post</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-07-05</td>\n",
" <td>20275.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1213</th>\n",
" <td>2701</td>\n",
" <td>Complaint 20/276 NZ National Party Facebook Post</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-07-05</td>\n",
" <td>20276.pdf</td>\n",
" <td>8</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3937</th>\n",
" <td>2701</td>\n",
" <td>Complaint 20/276 NZ National Party Facebook Post</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-07-05</td>\n",
" <td>20276.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1217</th>\n",
" <td>2704</td>\n",
" <td>Complaint 20/283 Harrisons Energy Solutions Te...</td>\n",
" <td>The Complainant was concerned about the refere...</td>\n",
" <td>2020-07-13</td>\n",
" <td>20283.pdf</td>\n",
" <td>8</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3938</th>\n",
" <td>2704</td>\n",
" <td>Complaint 20/283 Harrisons Energy Solutions Te...</td>\n",
" <td>The Complainant was concerned about the refere...</td>\n",
" <td>2020-07-13</td>\n",
" <td>20283.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1231</th>\n",
" <td>2721</td>\n",
" <td>Complaint 20/314 NZ National Party Facebook Post</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-07-23</td>\n",
" <td>20314.pdf</td>\n",
" <td>8</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3940</th>\n",
" <td>2721</td>\n",
" <td>Complaint 20/314 NZ National Party Facebook Post</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-07-23</td>\n",
" <td>20314.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1232</th>\n",
" <td>2722</td>\n",
" <td>Complaint 20/315 New Zealand Labour Party Twit...</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-07-23</td>\n",
" <td>20315.pdf</td>\n",
" <td>8</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3941</th>\n",
" <td>2722</td>\n",
" <td>Complaint 20/315 New Zealand Labour Party Twit...</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-07-23</td>\n",
" <td>20315.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1209</th>\n",
" <td>2809</td>\n",
" <td>Complaint 20/271 Vote Safe, Website and Billboard</td>\n",
" <td>The Complainant was concerned about the billbo...</td>\n",
" <td>2020-08-31</td>\n",
" <td>20271.pdf</td>\n",
" <td>8</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3935</th>\n",
" <td>2809</td>\n",
" <td>Complaint 20/271 Vote Safe, Website and Billboard</td>\n",
" <td>The Complainant was concerned about the billbo...</td>\n",
" <td>2020-08-31</td>\n",
" <td>20271.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1311</th>\n",
" <td>2835</td>\n",
" <td>Complaint 20/446 NZ National Party MP Brett Hu...</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-09-23</td>\n",
" <td>20446.pdf</td>\n",
" <td>8</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3945</th>\n",
" <td>2835</td>\n",
" <td>Complaint 20/446 NZ National Party MP Brett Hu...</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-09-23</td>\n",
" <td>20446.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3947</th>\n",
" <td>2836</td>\n",
" <td>Complaint 20/457 Voice for Life, Defend NZ, We...</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-09-25</td>\n",
" <td>20457.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3922</th>\n",
" <td>2836</td>\n",
" <td>Complaint 20/457 Voice for Life, Defend NZ, We...</td>\n",
" <td>The Chair declined to adjudicate the complaint...</td>\n",
" <td>2020-09-25</td>\n",
" <td>20457.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>No Jurisdiction</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1325</th>\n",
" <td>2846</td>\n",
" <td>Complaint 20/470 Vote Safe, YouTube</td>\n",
" <td>The Complainant was concerned the Advertiser “...</td>\n",
" <td>2020-09-29</td>\n",
" <td>20470.pdf</td>\n",
" <td>8</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3949</th>\n",
" <td>2846</td>\n",
" <td>Complaint 20/470 Vote Safe, YouTube</td>\n",
" <td>The Complainant was concerned the Advertiser “...</td>\n",
" <td>2020-09-29</td>\n",
" <td>20470.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1329</th>\n",
" <td>2909</td>\n",
" <td>Complaint 20/479 Appeal 20/018 Safer Future Ch...</td>\n",
" <td>The Chair of the Complaints Board ruled on 29 ...</td>\n",
" <td>2020-10-15</td>\n",
" <td>Complaint 20079 Appeal 20018.pdf</td>\n",
" <td>8</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/1...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3950</th>\n",
" <td>2909</td>\n",
" <td>Complaint 20/479 Appeal 20/018 Safer Future Ch...</td>\n",
" <td>The Chair of the Complaints Board ruled on 29 ...</td>\n",
" <td>2020-10-15</td>\n",
" <td>Complaint 20079 Appeal 20018.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/1...</td>\n",
" <td>Decline to Adjudicate</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-d0c89c02-2a67-4af9-bfe5-e7ee7bf27215')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-d0c89c02-2a67-4af9-bfe5-e7ee7bf27215 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-d0c89c02-2a67-4af9-bfe5-e7ee7bf27215');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-85efd830-4f40-4a12-84cd-cfcee4ef5f0e\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-85efd830-4f40-4a12-84cd-cfcee4ef5f0e')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-85efd830-4f40-4a12-84cd-cfcee4ef5f0e button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 221
}
]
},
{
"cell_type": "code",
"source": [
"# Some complaints are ruled as both \"No Grounds to Proceed\" and \"Decline to Adjudicate\" - let's take them as \"Decline to Adjudicate\" with keep=\"last\"\n",
"by_ruling = by_ruling.drop_duplicates(subset=\"id\", keep=\"last\")\n",
"by_ruling"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 597
},
"id": "7_aGRsb5b011",
"outputId": "eeeb4031-7e77-485b-c0e8-446dea34b4c3"
},
"execution_count": 222,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"0 3529 \n",
"1 1113 17/064 Briscoes Group Ltd Rebel Sport Television \n",
"2 1220 17/161 Fluoride Free NZ, Television \n",
"3 1268 17/201 SKY Television, Television \n",
"4 1283 17/224 Foodstuffs, Radio \n",
"... ... ... \n",
"4042 4216 Complaint 23/239 Hobson's Pledge Trust, Digita... \n",
"4043 4214 Complaint 23/241 NZ National Party, Digital Ma... \n",
"4044 4218 Complaint 23/242 New Zealand First, Out of Home \n",
"4045 4219 Complaint 23/243 ACT Party, Out of Home \n",
"4046 4217 Complaint 23/245 NZ National Party, Out of Home \n",
"\n",
" summary date \\\n",
"0 2021-11-08 \n",
"1 Complainant, L MacKinnon, said the ad refers t... 2017-03-08 \n",
"2 The Complainant’s concerns were that the adver... 2017-06-09 \n",
"3 The Chair acknowledged the Complainant’s conce... 2017-07-17 \n",
"4 The Complainant’s concern was that the Maori l... 2017-07-26 \n",
"... ... ... \n",
"4042 The relevant codes are Advertising Standards C... 2023-09-18 \n",
"4043 The relevant codes are Advertising Standards C... 2023-09-19 \n",
"4044 The relevant codes are Advertising Standards C... 2023-09-19 \n",
"4045 The relevant codes are Advertising Standards C... 2023-09-20 \n",
"4046 The relevant codes are Advertising Standards C... 2023-09-20 \n",
"\n",
" filename page url \\\n",
"0 None 0 https://cdn.asa.co.nz/backend/documents/2021/1... \n",
"1 17064.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/0... \n",
"2 17161.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/0... \n",
"3 17201.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/0... \n",
"4 17224.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/0... \n",
"... ... ... ... \n",
"4042 23239.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"4043 23241.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"4044 23242.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"4045 23243.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"4046 23245.pdf 0 https://cdn.asa.co.nz/backend/documents/2023/0... \n",
"\n",
" ruling \n",
"0 No Grounds to Proceed \n",
"1 No Grounds to Proceed \n",
"2 No Grounds to Proceed \n",
"3 No Grounds to Proceed \n",
"4 No Grounds to Proceed \n",
"... ... \n",
"4042 No Further Action \n",
"4043 No Further Action \n",
"4044 No Further Action \n",
"4045 No Further Action \n",
"4046 No Further Action \n",
"\n",
"[4037 rows x 8 columns]"
],
"text/html": [
"\n",
" <div id=\"df-86fcc112-a58e-4d09-ba00-73a4a7042a14\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>ruling</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>3529</td>\n",
" <td></td>\n",
" <td></td>\n",
" <td>2021-11-08</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2021/1...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1113</td>\n",
" <td>17/064 Briscoes Group Ltd Rebel Sport Television</td>\n",
" <td>Complainant, L MacKinnon, said the ad refers t...</td>\n",
" <td>2017-03-08</td>\n",
" <td>17064.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1220</td>\n",
" <td>17/161 Fluoride Free NZ, Television</td>\n",
" <td>The Complainant’s concerns were that the adver...</td>\n",
" <td>2017-06-09</td>\n",
" <td>17161.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1268</td>\n",
" <td>17/201 SKY Television, Television</td>\n",
" <td>The Chair acknowledged the Complainant’s conce...</td>\n",
" <td>2017-07-17</td>\n",
" <td>17201.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1283</td>\n",
" <td>17/224 Foodstuffs, Radio</td>\n",
" <td>The Complainant’s concern was that the Maori l...</td>\n",
" <td>2017-07-26</td>\n",
" <td>17224.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/0...</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4042</th>\n",
" <td>4216</td>\n",
" <td>Complaint 23/239 Hobson's Pledge Trust, Digita...</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-18</td>\n",
" <td>23239.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4043</th>\n",
" <td>4214</td>\n",
" <td>Complaint 23/241 NZ National Party, Digital Ma...</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-19</td>\n",
" <td>23241.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4044</th>\n",
" <td>4218</td>\n",
" <td>Complaint 23/242 New Zealand First, Out of Home</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-19</td>\n",
" <td>23242.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4045</th>\n",
" <td>4219</td>\n",
" <td>Complaint 23/243 ACT Party, Out of Home</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-20</td>\n",
" <td>23243.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4046</th>\n",
" <td>4217</td>\n",
" <td>Complaint 23/245 NZ National Party, Out of Home</td>\n",
" <td>The relevant codes are Advertising Standards C...</td>\n",
" <td>2023-09-20</td>\n",
" <td>23245.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2023/0...</td>\n",
" <td>No Further Action</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4037 rows × 8 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-86fcc112-a58e-4d09-ba00-73a4a7042a14')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-86fcc112-a58e-4d09-ba00-73a4a7042a14 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-86fcc112-a58e-4d09-ba00-73a4a7042a14');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-5436ed3d-37ac-47e2-8e10-b6bf215f8fac\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-5436ed3d-37ac-47e2-8e10-b6bf215f8fac')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-5436ed3d-37ac-47e2-8e10-b6bf215f8fac button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 222
}
]
},
{
"cell_type": "code",
"source": [
"df = df.merge(by_ruling[[\"id\", \"ruling\"]], on=\"id\")\n",
"df"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 597
},
"id": "Lk6zKiz4WcQZ",
"outputId": "ae3c11f4-9627-467c-b155-343896e09aa0"
},
"execution_count": 223,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"0 1391 17/279 Inspector Spot, Digital Marketing \n",
"1 617 Complaint 15/128 eGentics, Kiwi Rewards email ... \n",
"2 782 Complaint 15/205 Life Energy Designs, Website ... \n",
"3 383 Complaint 16/185 The Mix – On Demand\\t \n",
"4 678 Complaint 16/334 Kiwibank Ltd, Addressed Mail,... \n",
"... ... ... \n",
"4028 1713 Complaint 18/161 Tilt Renewables Viewing Platf... \n",
"4029 1837 Complaint 18/277 Garage Project Chocolate Beer... \n",
"4030 1931 Complaint 18/382 Lamont Wines, Packaging \n",
"4031 3566 Complaint 21/396 BurgerFuel, Player of the Day... \n",
"4032 3770 Complaint 22/097 Greenhill Beverages, Greenhil... \n",
"\n",
" summary date \\\n",
"0 The Complainant said the advertisement was mis... 2017-10-12 \n",
"1 Complainant C. Hayward felt the advertisement ... 2015-08-25 \n",
"2 Complainant M. Honeychurch said the efficacy o... 2015-11-04 \n",
"3 Complainant H. Topham said the advertisement s... 2016-06-15 \n",
"4 Complainant, S Astonn, said: “Email states 1 i... 2016-09-22 \n",
"... ... ... \n",
"4028 The Complainant was of the view the informati... 2018-06-18 \n",
"4029 The Complainant is concerned that the packagin... 2018-09-25 \n",
"4030 The Complainant was concerned the product name... 2018-12-04 \n",
"4031 The Complainant was concerned the advertisemen... 2021-11-23 \n",
"4032 The Complainant was concerned the images on th... 2022-06-01 \n",
"\n",
" filename page url \\\n",
"0 17279.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/1... \n",
"1 15128.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2 15205.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/1... \n",
"3 16185.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/0... \n",
"4 16334.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/0... \n",
"... ... ... ... \n",
"4028 18161.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/0... \n",
"4029 18277.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/0... \n",
"4030 18382.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/1... \n",
"4031 21396.pdf 0 https://cdn.asa.co.nz/backend/documents/2021/1... \n",
"4032 22097.pdf 0 https://cdn.asa.co.nz/backend/documents/2022/0... \n",
"\n",
" media ruling \n",
"0 Digital Marketing Not Upheld \n",
"1 Digital Marketing No Grounds to Proceed \n",
"2 Digital Marketing Upheld / Settled \n",
"3 Digital Marketing Upheld / Settled \n",
"4 Digital Marketing No Grounds to Proceed \n",
"... ... ... \n",
"4028 Other No Jurisdiction \n",
"4029 Other Not Upheld \n",
"4030 Other Upheld / Settled \n",
"4031 Other Upheld / Settled \n",
"4032 Other Upheld / Settled \n",
"\n",
"[4033 rows x 9 columns]"
],
"text/html": [
"\n",
" <div id=\"df-31c72eb0-8b0d-4c83-8f07-0b3220695952\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>media</th>\n",
" <th>ruling</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1391</td>\n",
" <td>17/279 Inspector Spot, Digital Marketing</td>\n",
" <td>The Complainant said the advertisement was mis...</td>\n",
" <td>2017-10-12</td>\n",
" <td>17279.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/1...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>Not Upheld</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>617</td>\n",
" <td>Complaint 15/128 eGentics, Kiwi Rewards email ...</td>\n",
" <td>Complainant C. Hayward felt the advertisement ...</td>\n",
" <td>2015-08-25</td>\n",
" <td>15128.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>782</td>\n",
" <td>Complaint 15/205 Life Energy Designs, Website ...</td>\n",
" <td>Complainant M. Honeychurch said the efficacy o...</td>\n",
" <td>2015-11-04</td>\n",
" <td>15205.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/1...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>Upheld / Settled</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>383</td>\n",
" <td>Complaint 16/185 The Mix – On Demand\\t</td>\n",
" <td>Complainant H. Topham said the advertisement s...</td>\n",
" <td>2016-06-15</td>\n",
" <td>16185.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/0...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>Upheld / Settled</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>678</td>\n",
" <td>Complaint 16/334 Kiwibank Ltd, Addressed Mail,...</td>\n",
" <td>Complainant, S Astonn, said: “Email states 1 i...</td>\n",
" <td>2016-09-22</td>\n",
" <td>16334.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/0...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>No Grounds to Proceed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4028</th>\n",
" <td>1713</td>\n",
" <td>Complaint 18/161 Tilt Renewables Viewing Platf...</td>\n",
" <td>The Complainant was of the view the informati...</td>\n",
" <td>2018-06-18</td>\n",
" <td>18161.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/0...</td>\n",
" <td>Other</td>\n",
" <td>No Jurisdiction</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4029</th>\n",
" <td>1837</td>\n",
" <td>Complaint 18/277 Garage Project Chocolate Beer...</td>\n",
" <td>The Complainant is concerned that the packagin...</td>\n",
" <td>2018-09-25</td>\n",
" <td>18277.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/0...</td>\n",
" <td>Other</td>\n",
" <td>Not Upheld</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4030</th>\n",
" <td>1931</td>\n",
" <td>Complaint 18/382 Lamont Wines, Packaging</td>\n",
" <td>The Complainant was concerned the product name...</td>\n",
" <td>2018-12-04</td>\n",
" <td>18382.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/1...</td>\n",
" <td>Other</td>\n",
" <td>Upheld / Settled</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4031</th>\n",
" <td>3566</td>\n",
" <td>Complaint 21/396 BurgerFuel, Player of the Day...</td>\n",
" <td>The Complainant was concerned the advertisemen...</td>\n",
" <td>2021-11-23</td>\n",
" <td>21396.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2021/1...</td>\n",
" <td>Other</td>\n",
" <td>Upheld / Settled</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4032</th>\n",
" <td>3770</td>\n",
" <td>Complaint 22/097 Greenhill Beverages, Greenhil...</td>\n",
" <td>The Complainant was concerned the images on th...</td>\n",
" <td>2022-06-01</td>\n",
" <td>22097.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2022/0...</td>\n",
" <td>Other</td>\n",
" <td>Upheld / Settled</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4033 rows × 9 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-31c72eb0-8b0d-4c83-8f07-0b3220695952')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-31c72eb0-8b0d-4c83-8f07-0b3220695952 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-31c72eb0-8b0d-4c83-8f07-0b3220695952');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-a9b290d3-ad60-46b3-a4e1-311d345a7a9f\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-a9b290d3-ad60-46b3-a4e1-311d345a7a9f')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-a9b290d3-ad60-46b3-a4e1-311d345a7a9f button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 223
}
]
},
{
"cell_type": "code",
"source": [
"df.ruling.value_counts(dropna=False)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "_u9wB5zEwBWu",
"outputId": "34b4f95f-6143-4704-8bcc-6cba82825bd0"
},
"execution_count": 224,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"No Grounds to Proceed 1909\n",
"Upheld / Settled 1317\n",
"Not Upheld 599\n",
"No Further Action 84\n",
"Withdrawn / Resolved 52\n",
"No Jurisdiction 44\n",
"Decline to Adjudicate 28\n",
"Name: ruling, dtype: int64"
]
},
"metadata": {},
"execution_count": 224
}
]
},
{
"cell_type": "code",
"source": [
"by_product = fetch_faceted(products, \"product\")\n",
"df = df.merge(by_product[[\"id\", \"product\"]], on=\"id\")\n",
"df"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 629,
"referenced_widgets": [
"58b562a8996a400781a1fcc46cc3ac29",
"5da788827035415f8e57d8ebc536917f",
"214208adda8c479aa2ee3c14ab21570b",
"149046fd000047a08fb8b8ce0f77a894",
"3a842e2871784b22ba35b9423a42f12c",
"bc21c41aedd24153a30d91a506e0986f",
"881956abef02439bb16fba2612cdf6c1",
"ecaf75a0fa384255ba682eabd5d1d487",
"e17efd80f9ff47e28b1c6faaa8b98aee",
"a78480df4d7a4b0088f29a756baff5c3",
"e26d2eb549824fa0bdb6f9a83a4de7c0"
]
},
"id": "MOh-vk_0twFp",
"outputId": "4a6c4153-c00a-49ab-85d9-32aa79059fbd"
},
"execution_count": 225,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
" 0%| | 0/13 [00:00<?, ?it/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "58b562a8996a400781a1fcc46cc3ac29"
}
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"0 1391 17/279 Inspector Spot, Digital Marketing \n",
"1 617 Complaint 15/128 eGentics, Kiwi Rewards email ... \n",
"2 782 Complaint 15/205 Life Energy Designs, Website ... \n",
"3 383 Complaint 16/185 The Mix – On Demand\\t \n",
"4 678 Complaint 16/334 Kiwibank Ltd, Addressed Mail,... \n",
"... ... ... \n",
"4027 1713 Complaint 18/161 Tilt Renewables Viewing Platf... \n",
"4028 1837 Complaint 18/277 Garage Project Chocolate Beer... \n",
"4029 1931 Complaint 18/382 Lamont Wines, Packaging \n",
"4030 3566 Complaint 21/396 BurgerFuel, Player of the Day... \n",
"4031 3770 Complaint 22/097 Greenhill Beverages, Greenhil... \n",
"\n",
" summary date \\\n",
"0 The Complainant said the advertisement was mis... 2017-10-12 \n",
"1 Complainant C. Hayward felt the advertisement ... 2015-08-25 \n",
"2 Complainant M. Honeychurch said the efficacy o... 2015-11-04 \n",
"3 Complainant H. Topham said the advertisement s... 2016-06-15 \n",
"4 Complainant, S Astonn, said: “Email states 1 i... 2016-09-22 \n",
"... ... ... \n",
"4027 The Complainant was of the view the informati... 2018-06-18 \n",
"4028 The Complainant is concerned that the packagin... 2018-09-25 \n",
"4029 The Complainant was concerned the product name... 2018-12-04 \n",
"4030 The Complainant was concerned the advertisemen... 2021-11-23 \n",
"4031 The Complainant was concerned the images on th... 2022-06-01 \n",
"\n",
" filename page url \\\n",
"0 17279.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/1... \n",
"1 15128.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2 15205.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/1... \n",
"3 16185.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/0... \n",
"4 16334.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/0... \n",
"... ... ... ... \n",
"4027 18161.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/0... \n",
"4028 18277.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/0... \n",
"4029 18382.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/1... \n",
"4030 21396.pdf 0 https://cdn.asa.co.nz/backend/documents/2021/1... \n",
"4031 22097.pdf 0 https://cdn.asa.co.nz/backend/documents/2022/0... \n",
"\n",
" media ruling product \n",
"0 Digital Marketing Not Upheld Services \n",
"1 Digital Marketing No Grounds to Proceed Entertainment \n",
"2 Digital Marketing Upheld / Settled Therapeutics and Health \n",
"3 Digital Marketing Upheld / Settled Alcohol \n",
"4 Digital Marketing No Grounds to Proceed Finance \n",
"... ... ... ... \n",
"4027 Other No Jurisdiction Other \n",
"4028 Other Not Upheld Alcohol \n",
"4029 Other Upheld / Settled Alcohol \n",
"4030 Other Upheld / Settled Food and Beverage \n",
"4031 Other Upheld / Settled Alcohol \n",
"\n",
"[4032 rows x 10 columns]"
],
"text/html": [
"\n",
" <div id=\"df-52187915-401c-4feb-81d9-5027b8eedf79\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>media</th>\n",
" <th>ruling</th>\n",
" <th>product</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1391</td>\n",
" <td>17/279 Inspector Spot, Digital Marketing</td>\n",
" <td>The Complainant said the advertisement was mis...</td>\n",
" <td>2017-10-12</td>\n",
" <td>17279.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/1...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>Not Upheld</td>\n",
" <td>Services</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>617</td>\n",
" <td>Complaint 15/128 eGentics, Kiwi Rewards email ...</td>\n",
" <td>Complainant C. Hayward felt the advertisement ...</td>\n",
" <td>2015-08-25</td>\n",
" <td>15128.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Entertainment</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>782</td>\n",
" <td>Complaint 15/205 Life Energy Designs, Website ...</td>\n",
" <td>Complainant M. Honeychurch said the efficacy o...</td>\n",
" <td>2015-11-04</td>\n",
" <td>15205.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/1...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Therapeutics and Health</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>383</td>\n",
" <td>Complaint 16/185 The Mix – On Demand\\t</td>\n",
" <td>Complainant H. Topham said the advertisement s...</td>\n",
" <td>2016-06-15</td>\n",
" <td>16185.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/0...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Alcohol</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>678</td>\n",
" <td>Complaint 16/334 Kiwibank Ltd, Addressed Mail,...</td>\n",
" <td>Complainant, S Astonn, said: “Email states 1 i...</td>\n",
" <td>2016-09-22</td>\n",
" <td>16334.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/0...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Finance</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4027</th>\n",
" <td>1713</td>\n",
" <td>Complaint 18/161 Tilt Renewables Viewing Platf...</td>\n",
" <td>The Complainant was of the view the informati...</td>\n",
" <td>2018-06-18</td>\n",
" <td>18161.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/0...</td>\n",
" <td>Other</td>\n",
" <td>No Jurisdiction</td>\n",
" <td>Other</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4028</th>\n",
" <td>1837</td>\n",
" <td>Complaint 18/277 Garage Project Chocolate Beer...</td>\n",
" <td>The Complainant is concerned that the packagin...</td>\n",
" <td>2018-09-25</td>\n",
" <td>18277.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/0...</td>\n",
" <td>Other</td>\n",
" <td>Not Upheld</td>\n",
" <td>Alcohol</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4029</th>\n",
" <td>1931</td>\n",
" <td>Complaint 18/382 Lamont Wines, Packaging</td>\n",
" <td>The Complainant was concerned the product name...</td>\n",
" <td>2018-12-04</td>\n",
" <td>18382.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/1...</td>\n",
" <td>Other</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Alcohol</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4030</th>\n",
" <td>3566</td>\n",
" <td>Complaint 21/396 BurgerFuel, Player of the Day...</td>\n",
" <td>The Complainant was concerned the advertisemen...</td>\n",
" <td>2021-11-23</td>\n",
" <td>21396.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2021/1...</td>\n",
" <td>Other</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Food and Beverage</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4031</th>\n",
" <td>3770</td>\n",
" <td>Complaint 22/097 Greenhill Beverages, Greenhil...</td>\n",
" <td>The Complainant was concerned the images on th...</td>\n",
" <td>2022-06-01</td>\n",
" <td>22097.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2022/0...</td>\n",
" <td>Other</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Alcohol</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4032 rows × 10 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-52187915-401c-4feb-81d9-5027b8eedf79')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-52187915-401c-4feb-81d9-5027b8eedf79 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-52187915-401c-4feb-81d9-5027b8eedf79');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-b47618fb-c86c-4505-bbfa-235e879c3f6d\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-b47618fb-c86c-4505-bbfa-235e879c3f6d')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-b47618fb-c86c-4505-bbfa-235e879c3f6d button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 225
}
]
},
{
"cell_type": "code",
"source": [
"df[\"product\"].value_counts()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "AApjlzugx60_",
"outputId": "eaaeecfd-a8fe-4b27-cdec-8ebabd159420"
},
"execution_count": 226,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"Advocacy 722\n",
"Therapeutics and Health 683\n",
"Household Goods 489\n",
"Food and Beverage 462\n",
"Services 426\n",
"Entertainment 341\n",
"Vehicles / Transportation 212\n",
"Alcohol 199\n",
"Finance 184\n",
"Apparel 114\n",
"Telecommunications 107\n",
"Electronic and ICT 49\n",
"Other 44\n",
"Name: product, dtype: int64"
]
},
"metadata": {},
"execution_count": 226
}
]
},
{
"cell_type": "code",
"source": [
"by_code = fetch_faceted(codes, \"code\")\n",
"by_code"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 629,
"referenced_widgets": [
"a5918099b4d542589c736cc9f8daa5ff",
"5dcde7f8a4e04c659d609fcefc913999",
"6daeab02faee4f03b431b2757ef03495",
"20388cf5a6404fb985714db0c275d5c3",
"d0bfa401a37448d796d764b31411e2db",
"366dc061ded54696b848344bf80cd11f",
"3eced34cce2a4170af09563c90d4a6ff",
"f8ffc9633ec946f6b48c73bf939771c1",
"501b420cba3c46bc872c6da84f9e1604",
"ad2b47f246954712970181feb0eb34c9",
"212aa1db0a3f4e66bd3ae5d4726df083"
]
},
"id": "gH4DywsEupl7",
"outputId": "f02c6f67-2028-411b-b68b-dbeebea95503"
},
"execution_count": 227,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
" 0%| | 0/18 [00:00<?, ?it/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "a5918099b4d542589c736cc9f8daa5ff"
}
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"0 1939 18/409 Burger King New Zealand Television \n",
"1 2241 ComplaIint 19/234 Affordable Scaffolding Ltd, ... \n",
"2 2400 Complaint 19/473 Visa, Television \n",
"3 3173 Complaint 21/126 Latitude Financial Services,... \n",
"4 1936 Complaint 18/398 Briscoes Group Ltd, Television \n",
"... ... ... \n",
"4420 728 Complaint 16/317 Whangarei Treatment Providers... \n",
"4421 756 Complaint 16/355 Waikato Health Clinic, Digita... \n",
"4422 864 Complaint 16/357 Float Well, Website \n",
"4423 869 Complaint 16/391 Brett Elliot’s Ultimate Herba... \n",
"4424 1132 Complaint 16/432 Read Auckland Website \n",
"\n",
" summary date \\\n",
"0 The Complainant was concerned the advertiseme... 2018-12-12 \n",
"1 The Complainant was concerned the advertisemen... 2019-08-16 \n",
"2 The Complainant was concerned the advertisemen... 2019-12-16 \n",
"3 The Complainant was concerned the advertisemen... 2021-04-15 \n",
"4 The Complainant was concerned the advertisemen... 2018-12-07 \n",
"... ... ... \n",
"4420 Complainant, M Hanna, said “It contains unsubs... 2016-10-17 \n",
"4421 Complainant, S Taylor, said: Ricky Gorringe a... 2016-10-31 \n",
"4422 Complainant M. Honeychurch said the therapeuti... 2016-11-28 \n",
"4423 Complainant, M. Honeychurch, said: “Use of the... 2016-12-01 \n",
"4424 Complainant, M. Willey, said the Read Auckland... 2016-12-13 \n",
"\n",
" filename page url \\\n",
"0 18409.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/1... \n",
"1 19234.pdf 0 https://cdn.asa.co.nz/backend/documents/2019/0... \n",
"2 19473.pdf 0 https://cdn.asa.co.nz/backend/documents/2019/1... \n",
"3 21126.pdf 0 https://cdn.asa.co.nz/backend/documents/2021/0... \n",
"4 18398.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/1... \n",
"... ... ... ... \n",
"4420 16317.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/1... \n",
"4421 16355.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/1... \n",
"4422 16357.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/1... \n",
"4423 16391.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/1... \n",
"4424 16432.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/1... \n",
"\n",
" code \n",
"0 Advertising Standards Code \n",
"1 Advertising Standards Code \n",
"2 Advertising Standards Code \n",
"3 Advertising Standards Code \n",
"4 Advertising Standards Code \n",
"... ... \n",
"4420 Therapeutic Services Advertising Code \n",
"4421 Therapeutic Services Advertising Code \n",
"4422 Therapeutic Services Advertising Code \n",
"4423 Therapeutic Services Advertising Code \n",
"4424 Therapeutic Services Advertising Code \n",
"\n",
"[4425 rows x 8 columns]"
],
"text/html": [
"\n",
" <div id=\"df-d5c0ff78-a56b-48cd-aae7-9a87a6ce75c4\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>code</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1939</td>\n",
" <td>18/409 Burger King New Zealand Television</td>\n",
" <td>The Complainant was concerned the advertiseme...</td>\n",
" <td>2018-12-12</td>\n",
" <td>18409.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/1...</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2241</td>\n",
" <td>ComplaIint 19/234 Affordable Scaffolding Ltd, ...</td>\n",
" <td>The Complainant was concerned the advertisemen...</td>\n",
" <td>2019-08-16</td>\n",
" <td>19234.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2019/0...</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2400</td>\n",
" <td>Complaint 19/473 Visa, Television</td>\n",
" <td>The Complainant was concerned the advertisemen...</td>\n",
" <td>2019-12-16</td>\n",
" <td>19473.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2019/1...</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>3173</td>\n",
" <td>Complaint 21/126 Latitude Financial Services,...</td>\n",
" <td>The Complainant was concerned the advertisemen...</td>\n",
" <td>2021-04-15</td>\n",
" <td>21126.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2021/0...</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1936</td>\n",
" <td>Complaint 18/398 Briscoes Group Ltd, Television</td>\n",
" <td>The Complainant was concerned the advertisemen...</td>\n",
" <td>2018-12-07</td>\n",
" <td>18398.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/1...</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4420</th>\n",
" <td>728</td>\n",
" <td>Complaint 16/317 Whangarei Treatment Providers...</td>\n",
" <td>Complainant, M Hanna, said “It contains unsubs...</td>\n",
" <td>2016-10-17</td>\n",
" <td>16317.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/1...</td>\n",
" <td>Therapeutic Services Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4421</th>\n",
" <td>756</td>\n",
" <td>Complaint 16/355 Waikato Health Clinic, Digita...</td>\n",
" <td>Complainant, S Taylor, said: Ricky Gorringe a...</td>\n",
" <td>2016-10-31</td>\n",
" <td>16355.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/1...</td>\n",
" <td>Therapeutic Services Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4422</th>\n",
" <td>864</td>\n",
" <td>Complaint 16/357 Float Well, Website</td>\n",
" <td>Complainant M. Honeychurch said the therapeuti...</td>\n",
" <td>2016-11-28</td>\n",
" <td>16357.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/1...</td>\n",
" <td>Therapeutic Services Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4423</th>\n",
" <td>869</td>\n",
" <td>Complaint 16/391 Brett Elliot’s Ultimate Herba...</td>\n",
" <td>Complainant, M. Honeychurch, said: “Use of the...</td>\n",
" <td>2016-12-01</td>\n",
" <td>16391.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/1...</td>\n",
" <td>Therapeutic Services Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4424</th>\n",
" <td>1132</td>\n",
" <td>Complaint 16/432 Read Auckland Website</td>\n",
" <td>Complainant, M. Willey, said the Read Auckland...</td>\n",
" <td>2016-12-13</td>\n",
" <td>16432.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/1...</td>\n",
" <td>Therapeutic Services Advertising Code</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4425 rows × 8 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-d5c0ff78-a56b-48cd-aae7-9a87a6ce75c4')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-d5c0ff78-a56b-48cd-aae7-9a87a6ce75c4 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-d5c0ff78-a56b-48cd-aae7-9a87a6ce75c4');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-1475d12c-433a-4ed3-b31e-715338e3bcc7\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-1475d12c-433a-4ed3-b31e-715338e3bcc7')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-1475d12c-433a-4ed3-b31e-715338e3bcc7 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 227
}
]
},
{
"cell_type": "code",
"source": [
"by_code[by_code.id.duplicated(keep=False)].sort_values(by=\"id\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 597
},
"id": "xSJvK1Qau-cQ",
"outputId": "f2c00b2f-2480-48fa-dd39-6f5d778fffc9"
},
"execution_count": 228,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"4392 1004 Complaint 15/371 Bhadra Kalmatha Astrology, Ne... \n",
"3244 1004 Complaint 15/371 Bhadra Kalmatha Astrology, Ne... \n",
"1916 1009 Complaint 15/365 Instant Finance, Television \n",
"2820 1009 Complaint 15/365 Instant Finance, Television \n",
"2827 101 Complaint 15/442 Brownzy Sports Bar, Outdoor \n",
"... ... ... \n",
"2750 988 Complaint 15/274 My Republic Television, Websi... \n",
"1997 989 Complaint 15/271 Lotto, Television \n",
"3184 989 Complaint 15/271 Lotto, Television \n",
"3194 997 Complaint 15/287 Foodstuffs New World, Newspaper \n",
"2500 997 Complaint 15/287 Foodstuffs New World, Newspaper \n",
"\n",
" summary date \\\n",
"4392 Complainant T. Singh said the advertisement wa... 2015-02-10 \n",
"3244 Complainant T. Singh said the advertisement wa... 2015-02-10 \n",
"1916 Complainant, P. Stevenson, said they objected ... 2015-02-10 \n",
"2820 Complainant, P. Stevenson, said they objected ... 2015-02-10 \n",
"2827 Complainant: M. Devon said they were offended ... 2015-11-02 \n",
"... ... ... \n",
"2750 Complainant, Vodafone New Zealand, said the cl... 2015-02-10 \n",
"1997 Complainant, D. McDonald, said: The Complainan... 2015-02-10 \n",
"3184 Complainant, D. McDonald, said: The Complainan... 2015-02-10 \n",
"3194 Complainant, A. Oates, said: the advertisemen... 2015-02-10 \n",
"2500 Complainant, A. Oates, said: the advertisemen... 2015-02-10 \n",
"\n",
" filename page url \\\n",
"4392 15371.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"3244 15371.pdf 1 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"1916 15365.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2820 15365.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2827 15442.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/1... \n",
"... ... ... ... \n",
"2750 15274.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"1997 15271.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"3184 15271.pdf 1 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"3194 15287.pdf 1 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2500 15287.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"\n",
" code \n",
"4392 Therapeutic Services Advertising Code \n",
"3244 Code of Ethics \n",
"1916 Financial Advertising Code \n",
"2820 Code for People in Advertising \n",
"2827 Code for People in Advertising \n",
"... ... \n",
"2750 Code for Comparative Advertising \n",
"1997 Gambling Advertising Code \n",
"3184 Code of Ethics \n",
"3194 Code of Ethics \n",
"2500 Code for Advertising and Promotion of Alcohol \n",
"\n",
"[807 rows x 8 columns]"
],
"text/html": [
"\n",
" <div id=\"df-bc63eddd-6ab7-447c-8c55-39f58473ec64\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>code</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>4392</th>\n",
" <td>1004</td>\n",
" <td>Complaint 15/371 Bhadra Kalmatha Astrology, Ne...</td>\n",
" <td>Complainant T. Singh said the advertisement wa...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15371.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Therapeutic Services Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3244</th>\n",
" <td>1004</td>\n",
" <td>Complaint 15/371 Bhadra Kalmatha Astrology, Ne...</td>\n",
" <td>Complainant T. Singh said the advertisement wa...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15371.pdf</td>\n",
" <td>1</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1916</th>\n",
" <td>1009</td>\n",
" <td>Complaint 15/365 Instant Finance, Television</td>\n",
" <td>Complainant, P. Stevenson, said they objected ...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15365.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Financial Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2820</th>\n",
" <td>1009</td>\n",
" <td>Complaint 15/365 Instant Finance, Television</td>\n",
" <td>Complainant, P. Stevenson, said they objected ...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15365.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Code for People in Advertising</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2827</th>\n",
" <td>101</td>\n",
" <td>Complaint 15/442 Brownzy Sports Bar, Outdoor</td>\n",
" <td>Complainant: M. Devon said they were offended ...</td>\n",
" <td>2015-11-02</td>\n",
" <td>15442.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/1...</td>\n",
" <td>Code for People in Advertising</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2750</th>\n",
" <td>988</td>\n",
" <td>Complaint 15/274 My Republic Television, Websi...</td>\n",
" <td>Complainant, Vodafone New Zealand, said the cl...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15274.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Code for Comparative Advertising</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1997</th>\n",
" <td>989</td>\n",
" <td>Complaint 15/271 Lotto, Television</td>\n",
" <td>Complainant, D. McDonald, said: The Complainan...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15271.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Gambling Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3184</th>\n",
" <td>989</td>\n",
" <td>Complaint 15/271 Lotto, Television</td>\n",
" <td>Complainant, D. McDonald, said: The Complainan...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15271.pdf</td>\n",
" <td>1</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3194</th>\n",
" <td>997</td>\n",
" <td>Complaint 15/287 Foodstuffs New World, Newspaper</td>\n",
" <td>Complainant, A. Oates, said: the advertisemen...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15287.pdf</td>\n",
" <td>1</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2500</th>\n",
" <td>997</td>\n",
" <td>Complaint 15/287 Foodstuffs New World, Newspaper</td>\n",
" <td>Complainant, A. Oates, said: the advertisemen...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15287.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Code for Advertising and Promotion of Alcohol</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>807 rows × 8 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-bc63eddd-6ab7-447c-8c55-39f58473ec64')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-bc63eddd-6ab7-447c-8c55-39f58473ec64 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-bc63eddd-6ab7-447c-8c55-39f58473ec64');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-1580be3d-0faa-4e04-956b-55ffb4b802f8\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-1580be3d-0faa-4e04-956b-55ffb4b802f8')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-1580be3d-0faa-4e04-956b-55ffb4b802f8 button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 228
}
]
},
{
"cell_type": "code",
"source": [
"by_code = by_code.drop_duplicates(subset=\"id\", keep=\"last\")\n",
"df = df.merge(by_code[[\"id\", \"code\"]], on=\"id\")\n",
"df"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 754
},
"id": "UDiqDcmCvnbB",
"outputId": "e3b17e20-ca1f-4510-f261-f2feb21903c6"
},
"execution_count": 229,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"0 1391 17/279 Inspector Spot, Digital Marketing \n",
"1 617 Complaint 15/128 eGentics, Kiwi Rewards email ... \n",
"2 782 Complaint 15/205 Life Energy Designs, Website ... \n",
"3 383 Complaint 16/185 The Mix – On Demand\\t \n",
"4 678 Complaint 16/334 Kiwibank Ltd, Addressed Mail,... \n",
"... ... ... \n",
"4002 1713 Complaint 18/161 Tilt Renewables Viewing Platf... \n",
"4003 1837 Complaint 18/277 Garage Project Chocolate Beer... \n",
"4004 1931 Complaint 18/382 Lamont Wines, Packaging \n",
"4005 3566 Complaint 21/396 BurgerFuel, Player of the Day... \n",
"4006 3770 Complaint 22/097 Greenhill Beverages, Greenhil... \n",
"\n",
" summary date \\\n",
"0 The Complainant said the advertisement was mis... 2017-10-12 \n",
"1 Complainant C. Hayward felt the advertisement ... 2015-08-25 \n",
"2 Complainant M. Honeychurch said the efficacy o... 2015-11-04 \n",
"3 Complainant H. Topham said the advertisement s... 2016-06-15 \n",
"4 Complainant, S Astonn, said: “Email states 1 i... 2016-09-22 \n",
"... ... ... \n",
"4002 The Complainant was of the view the informati... 2018-06-18 \n",
"4003 The Complainant is concerned that the packagin... 2018-09-25 \n",
"4004 The Complainant was concerned the product name... 2018-12-04 \n",
"4005 The Complainant was concerned the advertisemen... 2021-11-23 \n",
"4006 The Complainant was concerned the images on th... 2022-06-01 \n",
"\n",
" filename page url \\\n",
"0 17279.pdf 0 https://cdn.asa.co.nz/backend/documents/2017/1... \n",
"1 15128.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2 15205.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/1... \n",
"3 16185.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/0... \n",
"4 16334.pdf 0 https://cdn.asa.co.nz/backend/documents/2016/0... \n",
"... ... ... ... \n",
"4002 18161.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/0... \n",
"4003 18277.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/0... \n",
"4004 18382.pdf 0 https://cdn.asa.co.nz/backend/documents/2018/1... \n",
"4005 21396.pdf 0 https://cdn.asa.co.nz/backend/documents/2021/1... \n",
"4006 22097.pdf 0 https://cdn.asa.co.nz/backend/documents/2022/0... \n",
"\n",
" media ruling product \\\n",
"0 Digital Marketing Not Upheld Services \n",
"1 Digital Marketing No Grounds to Proceed Entertainment \n",
"2 Digital Marketing Upheld / Settled Therapeutics and Health \n",
"3 Digital Marketing Upheld / Settled Alcohol \n",
"4 Digital Marketing No Grounds to Proceed Finance \n",
"... ... ... ... \n",
"4002 Other No Jurisdiction Other \n",
"4003 Other Not Upheld Alcohol \n",
"4004 Other Upheld / Settled Alcohol \n",
"4005 Other Upheld / Settled Food and Beverage \n",
"4006 Other Upheld / Settled Alcohol \n",
"\n",
" code \n",
"0 Code of Ethics \n",
"1 Code of Ethics \n",
"2 Therapeutic Products Advertising Code \n",
"3 Code for Advertising and Promotion of Alcohol \n",
"4 Financial Advertising Code \n",
"... ... \n",
"4002 Code of Ethics \n",
"4003 Code for Advertising and Promotion of Alcohol \n",
"4004 Code for Advertising and Promotion of Alcohol \n",
"4005 Children and Young People's Advertising Code \n",
"4006 Alcohol Advertising and Promotion Code \n",
"\n",
"[4007 rows x 11 columns]"
],
"text/html": [
"\n",
" <div id=\"df-f818704b-81b4-49e2-a914-4a3b7b702c3a\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>media</th>\n",
" <th>ruling</th>\n",
" <th>product</th>\n",
" <th>code</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1391</td>\n",
" <td>17/279 Inspector Spot, Digital Marketing</td>\n",
" <td>The Complainant said the advertisement was mis...</td>\n",
" <td>2017-10-12</td>\n",
" <td>17279.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/1...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>Not Upheld</td>\n",
" <td>Services</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>617</td>\n",
" <td>Complaint 15/128 eGentics, Kiwi Rewards email ...</td>\n",
" <td>Complainant C. Hayward felt the advertisement ...</td>\n",
" <td>2015-08-25</td>\n",
" <td>15128.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Entertainment</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>782</td>\n",
" <td>Complaint 15/205 Life Energy Designs, Website ...</td>\n",
" <td>Complainant M. Honeychurch said the efficacy o...</td>\n",
" <td>2015-11-04</td>\n",
" <td>15205.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/1...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Therapeutics and Health</td>\n",
" <td>Therapeutic Products Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>383</td>\n",
" <td>Complaint 16/185 The Mix – On Demand\\t</td>\n",
" <td>Complainant H. Topham said the advertisement s...</td>\n",
" <td>2016-06-15</td>\n",
" <td>16185.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/0...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Alcohol</td>\n",
" <td>Code for Advertising and Promotion of Alcohol</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>678</td>\n",
" <td>Complaint 16/334 Kiwibank Ltd, Addressed Mail,...</td>\n",
" <td>Complainant, S Astonn, said: “Email states 1 i...</td>\n",
" <td>2016-09-22</td>\n",
" <td>16334.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/0...</td>\n",
" <td>Digital Marketing</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Finance</td>\n",
" <td>Financial Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4002</th>\n",
" <td>1713</td>\n",
" <td>Complaint 18/161 Tilt Renewables Viewing Platf...</td>\n",
" <td>The Complainant was of the view the informati...</td>\n",
" <td>2018-06-18</td>\n",
" <td>18161.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/0...</td>\n",
" <td>Other</td>\n",
" <td>No Jurisdiction</td>\n",
" <td>Other</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4003</th>\n",
" <td>1837</td>\n",
" <td>Complaint 18/277 Garage Project Chocolate Beer...</td>\n",
" <td>The Complainant is concerned that the packagin...</td>\n",
" <td>2018-09-25</td>\n",
" <td>18277.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/0...</td>\n",
" <td>Other</td>\n",
" <td>Not Upheld</td>\n",
" <td>Alcohol</td>\n",
" <td>Code for Advertising and Promotion of Alcohol</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4004</th>\n",
" <td>1931</td>\n",
" <td>Complaint 18/382 Lamont Wines, Packaging</td>\n",
" <td>The Complainant was concerned the product name...</td>\n",
" <td>2018-12-04</td>\n",
" <td>18382.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2018/1...</td>\n",
" <td>Other</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Alcohol</td>\n",
" <td>Code for Advertising and Promotion of Alcohol</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4005</th>\n",
" <td>3566</td>\n",
" <td>Complaint 21/396 BurgerFuel, Player of the Day...</td>\n",
" <td>The Complainant was concerned the advertisemen...</td>\n",
" <td>2021-11-23</td>\n",
" <td>21396.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2021/1...</td>\n",
" <td>Other</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Food and Beverage</td>\n",
" <td>Children and Young People's Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4006</th>\n",
" <td>3770</td>\n",
" <td>Complaint 22/097 Greenhill Beverages, Greenhil...</td>\n",
" <td>The Complainant was concerned the images on th...</td>\n",
" <td>2022-06-01</td>\n",
" <td>22097.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2022/0...</td>\n",
" <td>Other</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Alcohol</td>\n",
" <td>Alcohol Advertising and Promotion Code</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4007 rows × 11 columns</p>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f818704b-81b4-49e2-a914-4a3b7b702c3a')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-f818704b-81b4-49e2-a914-4a3b7b702c3a button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-f818704b-81b4-49e2-a914-4a3b7b702c3a');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-485409d2-3d9d-442d-bc31-b58427e024da\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-485409d2-3d9d-442d-bc31-b58427e024da')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-485409d2-3d9d-442d-bc31-b58427e024da button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 229
}
]
},
{
"cell_type": "code",
"source": [
"df[df.duplicated(subset=[\"summary\", \"filename\"], keep=False)]"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 710
},
"id": "idIg2eOob17e",
"outputId": "12cb4be1-0615-4011-917f-20be07aad12e"
},
"execution_count": 230,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"1992 1055 Complaint 15/389 Fluoride Free NZ, Newspaper \n",
"1993 1057 Complaint 15/389 Fluoride Free NZ, Newspaper \n",
"2090 3339 Complaint 19/448 Brett Elliot’s Ultimate Herba... \n",
"2091 2425 Complaint 19/488 Brett Elliot’s Ultimate Herba... \n",
"2180 999 Complaint 15/329 Youi Insurance, Television \n",
"2316 1023 Complaint 15/329 Youi Insurance, Television \n",
"2549 759 Complaint 16/363 Ticketmaster NZ, Television \n",
"2550 814 Complaint 16/363 Ticketmaster NZ, Television \n",
"3230 2690 Complaint 20/283 Harrisons Energy Solutions Te... \n",
"3231 2704 Complaint 20/283 Harrisons Energy Solutions Te... \n",
"\n",
" summary date \\\n",
"1992 Complainant K. Perrott said “my main complaint... 2015-02-10 \n",
"1993 Complainant K. Perrott said “my main complaint... 2015-02-10 \n",
"2090 The Complainant was concerned that it was unli... 2019-01-09 \n",
"2091 The Complainant was concerned that it was unli... 2020-01-09 \n",
"2180 Complainant, J. Whitehead, said: “The adverti... 2015-02-10 \n",
"2316 Complainant, J. Whitehead, said: “The adverti... 2015-02-10 \n",
"2549 Complainant, A. Ledger, said: Justin Bieber, ... 2016-10-31 \n",
"2550 Complainant, A. Ledger, said: Justin Bieber, ... 2016-11-17 \n",
"3230 The Complainant was concerned about the refere... 2020-07-13 \n",
"3231 The Complainant was concerned about the refere... 2020-07-13 \n",
"\n",
" filename page url \\\n",
"1992 15389.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"1993 15389.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2090 19448.pdf 0 https://cdn.asa.co.nz/backend/documents/2019/0... \n",
"2091 19448.pdf 0 https://cdn.asa.co.nz/backend/documents/2020/0... \n",
"2180 15329.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2316 15329.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2549 16363.pdf 2 https://cdn.asa.co.nz/backend/documents/2016/1... \n",
"2550 16363.pdf 2 https://cdn.asa.co.nz/backend/documents/2016/1... \n",
"3230 20283.pdf 7 https://cdn.asa.co.nz/backend/documents/2020/0... \n",
"3231 20283.pdf 7 https://cdn.asa.co.nz/backend/documents/2020/0... \n",
"\n",
" media ruling product \\\n",
"1992 Newspaper Not Upheld Advocacy \n",
"1993 Newspaper Not Upheld Advocacy \n",
"2090 Unaddressed Mail Upheld / Settled Therapeutics and Health \n",
"2091 Unaddressed Mail Upheld / Settled Therapeutics and Health \n",
"2180 Live Television Not Upheld Finance \n",
"2316 Live Television No Grounds to Proceed Finance \n",
"2549 Live Television No Grounds to Proceed Entertainment \n",
"2550 Live Television No Grounds to Proceed Entertainment \n",
"3230 Live Television No Grounds to Proceed Household Goods \n",
"3231 Live Television Decline to Adjudicate Household Goods \n",
"\n",
" code \n",
"1992 Code of Ethics \n",
"1993 Code of Ethics \n",
"2090 Therapeutic and Health Advertising Code \n",
"2091 Therapeutic and Health Advertising Code \n",
"2180 Code of Ethics \n",
"2316 Code of Ethics \n",
"2549 Code of Ethics \n",
"2550 Code of Ethics \n",
"3230 Advertising Standards Code \n",
"3231 Advertising Standards Code "
],
"text/html": [
"\n",
" <div id=\"df-2c979498-f97c-4e14-9071-06ee41400e63\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>media</th>\n",
" <th>ruling</th>\n",
" <th>product</th>\n",
" <th>code</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1992</th>\n",
" <td>1055</td>\n",
" <td>Complaint 15/389 Fluoride Free NZ, Newspaper</td>\n",
" <td>Complainant K. Perrott said “my main complaint...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15389.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Newspaper</td>\n",
" <td>Not Upheld</td>\n",
" <td>Advocacy</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1993</th>\n",
" <td>1057</td>\n",
" <td>Complaint 15/389 Fluoride Free NZ, Newspaper</td>\n",
" <td>Complainant K. Perrott said “my main complaint...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15389.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Newspaper</td>\n",
" <td>Not Upheld</td>\n",
" <td>Advocacy</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2090</th>\n",
" <td>3339</td>\n",
" <td>Complaint 19/448 Brett Elliot’s Ultimate Herba...</td>\n",
" <td>The Complainant was concerned that it was unli...</td>\n",
" <td>2019-01-09</td>\n",
" <td>19448.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2019/0...</td>\n",
" <td>Unaddressed Mail</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Therapeutics and Health</td>\n",
" <td>Therapeutic and Health Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2091</th>\n",
" <td>2425</td>\n",
" <td>Complaint 19/488 Brett Elliot’s Ultimate Herba...</td>\n",
" <td>The Complainant was concerned that it was unli...</td>\n",
" <td>2020-01-09</td>\n",
" <td>19448.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Unaddressed Mail</td>\n",
" <td>Upheld / Settled</td>\n",
" <td>Therapeutics and Health</td>\n",
" <td>Therapeutic and Health Advertising Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2180</th>\n",
" <td>999</td>\n",
" <td>Complaint 15/329 Youi Insurance, Television</td>\n",
" <td>Complainant, J. Whitehead, said: “The adverti...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15329.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Live Television</td>\n",
" <td>Not Upheld</td>\n",
" <td>Finance</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2316</th>\n",
" <td>1023</td>\n",
" <td>Complaint 15/329 Youi Insurance, Television</td>\n",
" <td>Complainant, J. Whitehead, said: “The adverti...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15329.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Live Television</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Finance</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2549</th>\n",
" <td>759</td>\n",
" <td>Complaint 16/363 Ticketmaster NZ, Television</td>\n",
" <td>Complainant, A. Ledger, said: Justin Bieber, ...</td>\n",
" <td>2016-10-31</td>\n",
" <td>16363.pdf</td>\n",
" <td>2</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/1...</td>\n",
" <td>Live Television</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Entertainment</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2550</th>\n",
" <td>814</td>\n",
" <td>Complaint 16/363 Ticketmaster NZ, Television</td>\n",
" <td>Complainant, A. Ledger, said: Justin Bieber, ...</td>\n",
" <td>2016-11-17</td>\n",
" <td>16363.pdf</td>\n",
" <td>2</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/1...</td>\n",
" <td>Live Television</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Entertainment</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3230</th>\n",
" <td>2690</td>\n",
" <td>Complaint 20/283 Harrisons Energy Solutions Te...</td>\n",
" <td>The Complainant was concerned about the refere...</td>\n",
" <td>2020-07-13</td>\n",
" <td>20283.pdf</td>\n",
" <td>7</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Live Television</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Household Goods</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3231</th>\n",
" <td>2704</td>\n",
" <td>Complaint 20/283 Harrisons Energy Solutions Te...</td>\n",
" <td>The Complainant was concerned about the refere...</td>\n",
" <td>2020-07-13</td>\n",
" <td>20283.pdf</td>\n",
" <td>7</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Live Television</td>\n",
" <td>Decline to Adjudicate</td>\n",
" <td>Household Goods</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-2c979498-f97c-4e14-9071-06ee41400e63')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-2c979498-f97c-4e14-9071-06ee41400e63 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-2c979498-f97c-4e14-9071-06ee41400e63');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-b2e211b6-1023-4521-82c6-21f21c0c578c\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-b2e211b6-1023-4521-82c6-21f21c0c578c')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-b2e211b6-1023-4521-82c6-21f21c0c578c button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 230
}
]
},
{
"cell_type": "code",
"source": [
"df[df.summary.str.contains(\"porn\")]"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 675
},
"id": "FtkmYBFo0WXV",
"outputId": "314e1c70-3d33-48f6-f71d-3dab0f00b82c"
},
"execution_count": 231,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" id title \\\n",
"221 2992 Complaint 20/375 Plarium Global Ltd, Raid Shad... \n",
"809 348 Complaint 16/120 MyRepublic, Digital Marketing \n",
"1584 951 Complaint 15/310 Rip Curl NZ, Billboard \n",
"2320 1033 Complaint 15/340 NZ Pork, On Demand \n",
"2549 759 Complaint 16/363 Ticketmaster NZ, Television \n",
"2550 814 Complaint 16/363 Ticketmaster NZ, Television \n",
"2713 1468 Complaint 17/368 Hanes Brands Inc – Berlei Bra... \n",
"3023 2200 Complaint 19/253 Rebel Sport, Television \n",
"3186 2611 Complaint 20/175 Frucor Beverages Ltd, V Energ... \n",
"3187 2658 Complaint 20/177 Department of Internal Affair... \n",
"\n",
" summary date \\\n",
"221 The Complainant was concerned the advertisemen... 2020-10-20 \n",
"809 Complainants S. Iles and X. Mao were offended ... 2016-05-23 \n",
"1584 Complainant, H. el Ojeili, said: “… The bill b... 2015-01-13 \n",
"2320 Complainant, J. Kavanagh, said: “The advert wa... 2015-02-10 \n",
"2549 Complainant, A. Ledger, said: Justin Bieber, ... 2016-10-31 \n",
"2550 Complainant, A. Ledger, said: Justin Bieber, ... 2016-11-17 \n",
"2713 Three Complainant’s shared similar views the a... 2017-11-29 \n",
"3023 The Complainant was concerned with the word ‘h... 2019-07-22 \n",
"3186 The Complainant was concerned it was inappropr... 2020-05-11 \n",
"3187 Eight Complainants are concerned the advertise... 2020-06-23 \n",
"\n",
" filename page url \\\n",
"221 20375.pdf 0 https://cdn.asa.co.nz/backend/documents/2020/1... \n",
"809 16120.pdf 1 https://cdn.asa.co.nz/backend/documents/2016/0... \n",
"1584 15310.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2320 15340.pdf 0 https://cdn.asa.co.nz/backend/documents/2015/0... \n",
"2549 16363.pdf 2 https://cdn.asa.co.nz/backend/documents/2016/1... \n",
"2550 16363.pdf 2 https://cdn.asa.co.nz/backend/documents/2016/1... \n",
"2713 17368.pdf 3 https://cdn.asa.co.nz/backend/documents/2017/1... \n",
"3023 19253.pdf 5 https://cdn.asa.co.nz/backend/documents/2019/0... \n",
"3186 20175.pdf 6 https://cdn.asa.co.nz/backend/documents/2020/0... \n",
"3187 20177.pdf 6 https://cdn.asa.co.nz/backend/documents/2020/0... \n",
"\n",
" media ruling product \\\n",
"221 Display No Grounds to Proceed Entertainment \n",
"809 Advertiser Website No Grounds to Proceed Telecommunications \n",
"1584 Billboard No Grounds to Proceed Apparel \n",
"2320 Live Television No Grounds to Proceed Food and Beverage \n",
"2549 Live Television No Grounds to Proceed Entertainment \n",
"2550 Live Television No Grounds to Proceed Entertainment \n",
"2713 Live Television Not Upheld Apparel \n",
"3023 Live Television No Grounds to Proceed Apparel \n",
"3186 Live Television No Grounds to Proceed Food and Beverage \n",
"3187 Live Television Not Upheld Advocacy \n",
"\n",
" code \n",
"221 Advertising Standards Code \n",
"809 Code of Ethics \n",
"1584 Code of Ethics \n",
"2320 Code of Ethics \n",
"2549 Code of Ethics \n",
"2550 Code of Ethics \n",
"2713 Code of Ethics \n",
"3023 Advertising Standards Code \n",
"3186 Advertising Standards Code \n",
"3187 Advertising Standards Code "
],
"text/html": [
"\n",
" <div id=\"df-e4d71cec-7883-44ed-ac94-dc988b5db8c5\" class=\"colab-df-container\">\n",
" <div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>title</th>\n",
" <th>summary</th>\n",
" <th>date</th>\n",
" <th>filename</th>\n",
" <th>page</th>\n",
" <th>url</th>\n",
" <th>media</th>\n",
" <th>ruling</th>\n",
" <th>product</th>\n",
" <th>code</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>221</th>\n",
" <td>2992</td>\n",
" <td>Complaint 20/375 Plarium Global Ltd, Raid Shad...</td>\n",
" <td>The Complainant was concerned the advertisemen...</td>\n",
" <td>2020-10-20</td>\n",
" <td>20375.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/1...</td>\n",
" <td>Display</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Entertainment</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>809</th>\n",
" <td>348</td>\n",
" <td>Complaint 16/120 MyRepublic, Digital Marketing</td>\n",
" <td>Complainants S. Iles and X. Mao were offended ...</td>\n",
" <td>2016-05-23</td>\n",
" <td>16120.pdf</td>\n",
" <td>1</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/0...</td>\n",
" <td>Advertiser Website</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Telecommunications</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1584</th>\n",
" <td>951</td>\n",
" <td>Complaint 15/310 Rip Curl NZ, Billboard</td>\n",
" <td>Complainant, H. el Ojeili, said: “… The bill b...</td>\n",
" <td>2015-01-13</td>\n",
" <td>15310.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Billboard</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Apparel</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2320</th>\n",
" <td>1033</td>\n",
" <td>Complaint 15/340 NZ Pork, On Demand</td>\n",
" <td>Complainant, J. Kavanagh, said: “The advert wa...</td>\n",
" <td>2015-02-10</td>\n",
" <td>15340.pdf</td>\n",
" <td>0</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2015/0...</td>\n",
" <td>Live Television</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Food and Beverage</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2549</th>\n",
" <td>759</td>\n",
" <td>Complaint 16/363 Ticketmaster NZ, Television</td>\n",
" <td>Complainant, A. Ledger, said: Justin Bieber, ...</td>\n",
" <td>2016-10-31</td>\n",
" <td>16363.pdf</td>\n",
" <td>2</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/1...</td>\n",
" <td>Live Television</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Entertainment</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2550</th>\n",
" <td>814</td>\n",
" <td>Complaint 16/363 Ticketmaster NZ, Television</td>\n",
" <td>Complainant, A. Ledger, said: Justin Bieber, ...</td>\n",
" <td>2016-11-17</td>\n",
" <td>16363.pdf</td>\n",
" <td>2</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2016/1...</td>\n",
" <td>Live Television</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Entertainment</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2713</th>\n",
" <td>1468</td>\n",
" <td>Complaint 17/368 Hanes Brands Inc – Berlei Bra...</td>\n",
" <td>Three Complainant’s shared similar views the a...</td>\n",
" <td>2017-11-29</td>\n",
" <td>17368.pdf</td>\n",
" <td>3</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2017/1...</td>\n",
" <td>Live Television</td>\n",
" <td>Not Upheld</td>\n",
" <td>Apparel</td>\n",
" <td>Code of Ethics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3023</th>\n",
" <td>2200</td>\n",
" <td>Complaint 19/253 Rebel Sport, Television</td>\n",
" <td>The Complainant was concerned with the word ‘h...</td>\n",
" <td>2019-07-22</td>\n",
" <td>19253.pdf</td>\n",
" <td>5</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2019/0...</td>\n",
" <td>Live Television</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Apparel</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3186</th>\n",
" <td>2611</td>\n",
" <td>Complaint 20/175 Frucor Beverages Ltd, V Energ...</td>\n",
" <td>The Complainant was concerned it was inappropr...</td>\n",
" <td>2020-05-11</td>\n",
" <td>20175.pdf</td>\n",
" <td>6</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Live Television</td>\n",
" <td>No Grounds to Proceed</td>\n",
" <td>Food and Beverage</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3187</th>\n",
" <td>2658</td>\n",
" <td>Complaint 20/177 Department of Internal Affair...</td>\n",
" <td>Eight Complainants are concerned the advertise...</td>\n",
" <td>2020-06-23</td>\n",
" <td>20177.pdf</td>\n",
" <td>6</td>\n",
" <td>https://cdn.asa.co.nz/backend/documents/2020/0...</td>\n",
" <td>Live Television</td>\n",
" <td>Not Upheld</td>\n",
" <td>Advocacy</td>\n",
" <td>Advertising Standards Code</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <div class=\"colab-df-buttons\">\n",
"\n",
" <div class=\"colab-df-container\">\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-e4d71cec-7883-44ed-ac94-dc988b5db8c5')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
"\n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
" </svg>\n",
" </button>\n",
"\n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" .colab-df-buttons div {\n",
" margin-bottom: 4px;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-e4d71cec-7883-44ed-ac94-dc988b5db8c5 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-e4d71cec-7883-44ed-ac94-dc988b5db8c5');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
"\n",
"\n",
"<div id=\"df-a2b60622-ef9b-4a54-a980-e05c2c9ea92b\">\n",
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-a2b60622-ef9b-4a54-a980-e05c2c9ea92b')\"\n",
" title=\"Suggest charts.\"\n",
" style=\"display:none;\">\n",
"\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <g>\n",
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
" </g>\n",
"</svg>\n",
" </button>\n",
"\n",
"<style>\n",
" .colab-df-quickchart {\n",
" --bg-color: #E8F0FE;\n",
" --fill-color: #1967D2;\n",
" --hover-bg-color: #E2EBFA;\n",
" --hover-fill-color: #174EA6;\n",
" --disabled-fill-color: #AAA;\n",
" --disabled-bg-color: #DDD;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-quickchart {\n",
" --bg-color: #3B4455;\n",
" --fill-color: #D2E3FC;\n",
" --hover-bg-color: #434B5C;\n",
" --hover-fill-color: #FFFFFF;\n",
" --disabled-bg-color: #3B4455;\n",
" --disabled-fill-color: #666;\n",
" }\n",
"\n",
" .colab-df-quickchart {\n",
" background-color: var(--bg-color);\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: var(--fill-color);\n",
" height: 32px;\n",
" padding: 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-quickchart:hover {\n",
" background-color: var(--hover-bg-color);\n",
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: var(--button-hover-fill-color);\n",
" }\n",
"\n",
" .colab-df-quickchart-complete:disabled,\n",
" .colab-df-quickchart-complete:disabled:hover {\n",
" background-color: var(--disabled-bg-color);\n",
" fill: var(--disabled-fill-color);\n",
" box-shadow: none;\n",
" }\n",
"\n",
" .colab-df-spinner {\n",
" border: 2px solid var(--fill-color);\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" animation:\n",
" spin 1s steps(1) infinite;\n",
" }\n",
"\n",
" @keyframes spin {\n",
" 0% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" border-left-color: var(--fill-color);\n",
" }\n",
" 20% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 30% {\n",
" border-color: transparent;\n",
" border-left-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 40% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-top-color: var(--fill-color);\n",
" }\n",
" 60% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" }\n",
" 80% {\n",
" border-color: transparent;\n",
" border-right-color: var(--fill-color);\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" 90% {\n",
" border-color: transparent;\n",
" border-bottom-color: var(--fill-color);\n",
" }\n",
" }\n",
"</style>\n",
"\n",
" <script>\n",
" async function quickchart(key) {\n",
" const quickchartButtonEl =\n",
" document.querySelector('#' + key + ' button');\n",
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
" try {\n",
" const charts = await google.colab.kernel.invokeFunction(\n",
" 'suggestCharts', [key], {});\n",
" } catch (error) {\n",
" console.error('Error during call to suggestCharts:', error);\n",
" }\n",
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
" }\n",
" (() => {\n",
" let quickchartButtonEl =\n",
" document.querySelector('#df-a2b60622-ef9b-4a54-a980-e05c2c9ea92b button');\n",
" quickchartButtonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
" })();\n",
" </script>\n",
"</div>\n",
" </div>\n",
" </div>\n"
]
},
"metadata": {},
"execution_count": 231
}
]
},
{
"cell_type": "code",
"source": [
"df.to_csv(\"ASA_decisions.csv\", index=False)"
],
"metadata": {
"id": "ujkjMLlcbmkG"
},
"execution_count": 232,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment