Replies: 4 comments 19 replies
-
When using Splink to generate a chart, it will by default render the chart only in interactive environments. These include Jupyter notebooks or the interactive IPython kernel within Visual Studio Code. However, if you're running them as a Python script, the charting functions will only produce a JSON representation of the chart. If you wish to save the chart as an HTML file that can be viewed offline, assign the chart to a variable. Following this, utilize the Line 2436 in aba0f5f Also note that if Altair is not installed, all charting functions will return the json representation rather than the Altair chart |
Beta Was this translation helpful? Give feedback.
-
Thanks for the information. I tried to get Splink generate and render chart in both notebooks and the interactive IPython kernel within Visual Studio Code, but it only produced JSON outputs.
In Jupyter notebook, save_offline_chart works for me as I can refer to the HTML outside of the notebook now.
Thank you!
From: Robin Linacre ***@***.***>
Sent: Tuesday, May 23, 2023 2:36 AM
To: moj-analytical-services/splink ***@***.***>
Cc: Yadav, Pramod K ***@***.***>; Author ***@***.***>
Subject: Re: [moj-analytical-services/splink] Help with missingness_chart() (Discussion #1247)
You don't often get email from ***@***.******@***.***>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
When using Splink to generate a chart, it will by default render the chart only in interactive environments. These include Jupyter notebooks or the interactive IPython kernel within Visual Studio Code. However, if you're running them as a Python script, the charting functions will only produce a JSON representation of the chart.
If you wish to save the chart as an HTML file that can be viewed offline, assign the chart to a variable. Following this, utilize the save_offline_chart function. More information about this function can be found at the following URL:
https://github.com/moj-analytical-services/splink/blob/aba0f5f2ba40958ee642f69df836c1e53cacf9c1/splink/linker.py#L2436
-
Reply to this email directly, view it on GitHub<#1247 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BAAEHKI4A7NJ7ZPGOQAHHHDXHRSHFANCNFSM6AAAAAAYJUHC4Y>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
My bad, I should have mentioned before - to save the offline chart, I did use "save_offline_chart(c,"test_chart.html",overwrite=True)"
From: mashby1966 ***@***.***>
Sent: Wednesday, June 7, 2023 3:56 PM
To: moj-analytical-services/splink ***@***.***>
Cc: Yadav, Pramod K ***@***.***>; Author ***@***.***>
Subject: Re: [moj-analytical-services/splink] Help with missingness_chart() (Discussion #1247)
I have version 5.0.1 installed.
BTW - (not sure if it is relevant) if I use the line "save_offline_chart(c.spec,"test_chart.html",overwrite=True)"` as suggested, I get a "'dict' object has no attribute 'spec'" error however if I use "save_offline_chart(c,"test_chart.html",overwrite=True)" it works and I can view the test_chart.html in a browser.
Thanks
-
Reply to this email directly, view it on GitHub<#1247 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BAAEHKLSDBR7V6BKONVKBP3XKDTFVANCNFSM6AAAAAAYJUHC4Y>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
Hi Can anyone help me resolve below error please? Whenever I am running below code in jupyter- I am getting error like - File ~\PycharmProjects\pythonProject1\venv1\lib\site-packages\splink\model.py:257, in Model.all_charts_write_html_file(self, filename, overwrite) File C:\Users\2202055\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py:19, in IncrementalEncoder.encode(self, input, final) UnicodeEncodeError: 'charmap' codec can't encode character '\u2212' in position 23084: character maps to But when I am running code for getting other charts like below, charts are getting displayed without any error in jupyter- Why are individual chart's code running properly but code for making all charts giving error? How can I resolve it? I am uisng altair version 4, alt.renderers.enable("default") |
Beta Was this translation helpful? Give feedback.
-
Hi,
Please bear with my beginner level programming skill and help on the following.
I am trying to replicate splink demo available on github. I am successfully doing many things from the demo except charting. To start with, missingness_chart() just spits json looking output rather than a chart. My working code is:
output:
Any ideas to fix the issue here?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions