I have used matplotlib for visualization and wrote an entire no code for visualizing my data.
TypeError: this.Plotly.newPlot is not a function in Microsoft Learn platform
I am using the Microsoft Learn platform https://learn.microsoft.com/en-us/training/modules/introduction-to-classical-machine-learning/3-exercise-separate-data-test-model
The kernel I have selected is azureml_py38
The code that is being executed within the sandbox is as follows:
import graphing # Custom graphing code. See our GitHub repository for details
# Let's take a quick look at our data
graphing.scatter_2D(data, label_x="date", label_y="min_temperature", title="January Temperatures (°F)")
I get this error any time the graphing
library is being used:
TypeError: this.Plotly.newPlot is not a function
I am using the Chrome browser on Ubuntu 20.04.6 LTS
4 answers
Sort by: Most helpful
-
-
Matti Leskinen 5 Reputation points
2023-11-15T13:10:11.8366667+00:00 I asked this from the Bing AI chatbot
Change this following code to use matplotlib
import graphing # Custom graphing code. See our GitHub repository for details
graphing.scatter_2D(data, label_x="date", label_y="min_temperature", title="January Temperatures (°F)")
And atleast it's drawing something now.
Hope this helps.
-
Crhistian Souza 5 Reputation points
2024-02-20T22:07:15.32+00:00 Hi Guys! On top of all, I'm very disappointed that a Microsoft Learn course shows issues like that! :-( That said, I found to contour this problem by using ChatGPT to help me migrate all code of the module I am studying to my local computer. I copied and saved the code into Python script files (.py), including the problematic graphing unit, which I saved locally as graphing.py. By doing this I finally could figure out what modules were used in graphing that I had to install on my computer. After some back and forth, voilà! I finally can see the graphs! I'm running all this in Visual Studio. Anyway, this solution was also a great opportunity for me to learn more about Python scripts, that's I suggest you to try the same!
-
Q&A Assist
2023-10-19T22:32:37.13+00:00 AI generated content. This question contains an answer created with AI from Q&A Assist. Learn moreThe error message
TypeError: this.Plotly.newPlot is not a function
suggests that thePlotly
function is not being recognized as a function. This could be due to a few reasons, such as thePlotly
library not being properly installed or imported.Based on the provided context, it seems that the
Plotly
library needs to be installed and attached to the cluster in order to be used. Additionally, theoutput_type
argument needs to be specified as'div'
when calling theplot()
function, and the output of theplot()
function needs to be passed to thedisplayHTML()
function.It's possible that the
graphing
library being used in the code is not properly importing or using thePlotly
library. I would recommend checking thegraphing
library code to ensure thatPlotly
is being properly imported and used.References: