<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: error when run python code(created through JMP formula depot ) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54503#M30814</link>
    <description>&lt;P&gt;Nasif,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your knowledgable and quick reply.&amp;nbsp; It works very well for this. I will try more complicated python code created by JMP (Boosted tree/Random Forest formula, although looks like take long time even copy and paste jupyter notebook)&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Apr 2018 19:20:50 GMT</pubDate>
    <dc:creator>lucy_luo_conoco</dc:creator>
    <dc:date>2018-04-05T19:20:50Z</dc:date>
    <item>
      <title>error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54493#M30807</link>
      <description>&lt;P&gt;JMP model would give me a formula and I want pass the formula and used it in python or R program.&lt;/P&gt;&lt;P&gt;Through formula depot, it generated Python code, and I tried to copy the python code and run it through Jupiter Notebook, but always give me error :&lt;/P&gt;&lt;P&gt;for example, I attached the test file and python code created from JMP and run. it didn't recognize&amp;nbsp; as array...&amp;nbsp;please help. thanks!!! I thought it is easy to copy JMP created python code and run python with no problem. looks it is not.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def score(indata, outdata):&lt;BR /&gt;_temp_0 = u""&lt;/P&gt;&lt;P&gt;if (indata[u"Num"] &amp;gt; 50):&lt;BR /&gt;_temp_0 = u"High"&lt;BR /&gt;else:&lt;BR /&gt;_temp_0 = u"Low"&lt;BR /&gt;outdata[u"class"] = _temp_0&lt;/P&gt;&lt;P&gt;return outdata[u"class"]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="container"&gt;&lt;DIV class="cell code_cell rendered selected"&gt;&lt;DIV class="output_wrapper"&gt;&lt;DIV class="output"&gt;&lt;DIV class="output_area"&gt;&lt;DIV class="output_subarea output_text output_error"&gt;&lt;PRE&gt;&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt; 890&lt;/SPAN&gt;         raise ValueError("The truth value of a {0} is ambiguous. "
&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;    891&lt;/SPAN&gt;                          &lt;SPAN class="ansi-blue-fg"&gt;"Use a.empty, a.bool(), a.item(), a.any() or a.all()."&lt;/SPAN&gt;
&lt;SPAN class="ansi-green-fg"&gt;--&amp;gt; 892&lt;/SPAN&gt;&lt;SPAN class="ansi-red-fg"&gt;                          .format(self.__class__.__name__))&lt;/SPAN&gt;&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;    893&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the following is python code from JMP&lt;/P&gt;&lt;P&gt;from __future__ import division&lt;BR /&gt;from math import *&lt;BR /&gt;import jmp_score as jmp&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;""" ==================================================================&lt;BR /&gt;Copyright(C) 2018 SAS Institute Inc.All rights reserved.&lt;BR /&gt;&lt;BR /&gt;Notice:&lt;BR /&gt;The following permissions are granted provided that the&lt;BR /&gt;above copyright and this notice appear in the score code and&lt;BR /&gt;any related documentation.Permission to copy, modify&lt;BR /&gt;and distribute the score code generated using&lt;BR /&gt;JMP(R) software is limited to customers of SAS Institute Inc. ("SAS")&lt;BR /&gt;and successive third parties, all without any warranty, express or&lt;BR /&gt;implied, or any other obligation by SAS.SAS and all other SAS&lt;BR /&gt;Institute.Inc.product and service names are registered&lt;BR /&gt;trademarks or trademarks of SAS Institute Inc.in the USA&lt;BR /&gt;and other countries.Except as contained in this notice,&lt;BR /&gt;the name of the SAS Institute Inc. and JMP shall not be used in&lt;BR /&gt;the advertising or promotion of products or services without&lt;BR /&gt;prior written authorization from SAS Institute Inc.&lt;BR /&gt;================================================================== """&lt;/P&gt;&lt;P&gt;""" Python code generated by JMP v13.2.1 """&lt;/P&gt;&lt;P&gt;def getModelMetadata():&lt;BR /&gt;return {"creator": u"Column class", "modelName": u"", "predicted": u"", "table": u"Sheet2", "version": u"13.2.1", "timestamp": u"2018-04-05T16:10:16Z"}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def getInputMetadata():&lt;BR /&gt;return {&lt;BR /&gt;u"Num": "float"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def getOutputMetadata():&lt;BR /&gt;return {&lt;BR /&gt;u"class": "str"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def score(indata, outdata):&lt;BR /&gt;_temp_0 = u""&lt;/P&gt;&lt;P&gt;if (indata[u"Num"] &amp;gt; 50):&lt;BR /&gt;_temp_0 = u"High"&lt;BR /&gt;else:&lt;BR /&gt;_temp_0 = u"Low"&lt;BR /&gt;outdata[u"class"] = _temp_0&lt;/P&gt;&lt;P&gt;return outdata[u"class"]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the data is looks like&lt;/P&gt;&lt;P&gt;Num Class&lt;/P&gt;&lt;P&gt;15 Low&lt;BR /&gt;17 Low&lt;BR /&gt;200 High&lt;BR /&gt;60 High&lt;BR /&gt;72 High&lt;BR /&gt;10 Low&lt;BR /&gt;20 Low&lt;BR /&gt;70 High&lt;BR /&gt;55 High&lt;BR /&gt;20 Low&lt;BR /&gt;854 High&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 05 Apr 2018 16:27:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54493#M30807</guid>
      <dc:creator>lucy_luo_conoco</dc:creator>
      <dc:date>2018-04-05T16:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54502#M30813</link>
      <description>&lt;P&gt;Hi Lucy,&lt;/P&gt;
&lt;P&gt;The short answer is that you have to use a data structure to hold your data that is compatible with the code generated by JMP. It expects the input and output arguments to be of a dictionary-like type, where values can be&amp;nbsp;accessed and written by key. The ideal data structure to use for a table is a Pandas DataFrame. Here is how you would add a new column to a DataFrame using the JMP score function from your example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import pandas as pd&lt;BR /&gt;&lt;BR /&gt;indata_df = pd.read_table(testdata, sep = ',')
indata_df['predicted_class'] = indata_df.apply(lambda s: score(s, {}), axis=1)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please see the attached files for a complete example. Also, please take a look at the example code attached to the Discovery presentations where the Formula Depot code generation was covered, &lt;A href="https://community.jmp.com/t5/Discovery-Summit-2016/Scoring-Outside-the-Box/ta-p/22381" target="_blank"&gt;Scoring Outside the Box&lt;/A&gt;&amp;nbsp;and &lt;A href="https://community.jmp.com/t5/Discovery-Summit-2017/Sharing-the-Ultimate-Boon-A-Journey-From-Modeling-to-Scoring/ta-p/46020" target="_blank"&gt;Sharing the Ultimate Boon&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 18:51:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54502#M30813</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2018-04-05T18:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54503#M30814</link>
      <description>&lt;P&gt;Nasif,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your knowledgable and quick reply.&amp;nbsp; It works very well for this. I will try more complicated python code created by JMP (Boosted tree/Random Forest formula, although looks like take long time even copy and paste jupyter notebook)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 19:20:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54503#M30814</guid>
      <dc:creator>lucy_luo_conoco</dc:creator>
      <dc:date>2018-04-05T19:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54504#M30815</link>
      <description>&lt;P&gt;Nasif,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;one more question, in the newer version, Formular Depot will generate R code? thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 19:24:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54504#M30815</guid>
      <dc:creator>lucy_luo_conoco</dc:creator>
      <dc:date>2018-04-05T19:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54505#M30816</link>
      <description>&lt;P&gt;Glad you find it helpful! I would suggest that you do not copy and paste the JMP code into the notebook - that only works for very small models and the two you mentioned can be quite large. Instead, just import the generated file as in the Discovery notebook examples I mentioned.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is&amp;nbsp;a tip: start your notebook in the same directory you saved the JMP-generated python code, as well as a copy of the helper file jmp_score.py file that comes with&amp;nbsp;the product, so that Python can find them more easily. See this &lt;A href="https://community.jmp.com/t5/Discussions/Scoring-outside-the-box-using-JMP-13-pro-macosx/m-p/45514#M26017" target="_self"&gt;discussion&lt;/A&gt; for more details.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 19:30:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54505#M30816</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2018-04-05T19:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54506#M30817</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have had requests for R language code generation but unfortunately, it is not on the product or on the&amp;nbsp;roadmap yet.&lt;/P&gt;
&lt;P&gt;I would suggest adding an entry to the &lt;A href="https://community.jmp.com/t5/JMP-Wish-List/idb-p/jmp-wish-list" target="_self"&gt;JMP Wish List&lt;/A&gt;&amp;nbsp;so that we can track the general interest in this feature.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 19:32:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54506#M30817</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2018-04-05T19:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54507#M30818</link>
      <description>&lt;P&gt;yeah, it is really a good suggestion!!! I am not good at python since I have been&amp;nbsp;writing SAS codes for 20 years.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 19:47:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54507#M30818</guid>
      <dc:creator>lucy_luo_conoco</dc:creator>
      <dc:date>2018-04-05T19:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54508#M30819</link>
      <description>&lt;P&gt;that would be good if JMP could add R code. especially our industry use Spotfire and R codes will be easily embeded with Spotfire.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 19:51:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54508#M30819</guid>
      <dc:creator>lucy_luo_conoco</dc:creator>
      <dc:date>2018-04-05T19:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54509#M30820</link>
      <description>&lt;P&gt;I don't have access to Spotfire so it is not possible for me to try it, but&amp;nbsp;apparently, it is possible to run Python code in SpotFire too.&lt;/P&gt;
&lt;P&gt;Please take a look at these links, they might help:&lt;/P&gt;
&lt;P&gt;*&amp;nbsp;&lt;A href="https://community.tibco.com/wiki/how-deploy-custom-python-modules-use-tibco-spotfirer-clients" target="_blank"&gt;https://community.tibco.com/wiki/how-deploy-custom-python-modules-use-tibco-spotfirer-clients&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;*&amp;nbsp;&lt;A href="https://community.tibco.com/questions/call-local-python-spotfire" target="_blank"&gt;https://community.tibco.com/questions/call-local-python-spotfire&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 19:56:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/54509#M30820</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2018-04-05T19:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/57125#M32046</link>
      <description>Nascif, &lt;A href="https://community.jmp.com/t5/Discovery-Summit-2016/Scoring-Outside-the-Box/ta-p/22381" target="_blank"&gt;https://community.jmp.com/t5/Discovery-Summit-2016/Scoring-Outside-the-Box/ta-p/22381&lt;/A&gt; the example in this presentation really help me a lot. Great presentation and thank you so much for sharing the example and code.</description>
      <pubDate>Thu, 17 May 2018 00:42:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/57125#M32046</guid>
      <dc:creator>lucy_luo_conoco</dc:creator>
      <dc:date>2018-05-17T00:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/57127#M32048</link>
      <description>So glad it helped, Lucy!</description>
      <pubDate>Thu, 17 May 2018 00:54:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/57127#M32048</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2018-05-17T00:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/302739#M55991</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;was triyng to implement the same method using a 'Dict' with 2 parameters, and got the error :&lt;/P&gt;&lt;P&gt;"TypeError: can't multiply sequence by non-int of type 'float'"&lt;/P&gt;&lt;P&gt;please assist&lt;/P&gt;&lt;P&gt;attached the PY code :&lt;/P&gt;&lt;PRE&gt;#set parameters
indata_aa =  {'DESIGN_LAYERS': '3','EXISTS_LASER_DRILL' : 'YES' } 
 
def getModelMetadata():
	return {"creator": u"Formula Editor", "modelName": u"", "predicted": u"", "table": u"NEW JMP Pricing 30 RIGID SHORT", "version": u"15.0.0", "timestamp": u"2020-08-30T10:46:03Z"}


def getInputMetadata():
    return {
        u"DESIGN_LAYERS": "float",
        u"EXISTS_LASER_DRILL": "str"
        
	}


def getOutputMetadata():
    return {
        u"Add": "float"
	}


def score(indata, outdata):
    _temp_0 = np.nan

    if (indata[u"EXISTS_LASER_DRILL"] == u"NO"):
        _temp_0 = -130.203324304508
    elif (indata[u"EXISTS_LASER_DRILL"] == u"YES"):
        _temp_0 = 130.203324304508
    else:
        _temp_0 = np.nan
        print (_temp_0)
    outdata = 358.593374276362 + 26.8517927560789 * indata[u"DESIGN_LAYERS"] + _temp_0

    return outdata["Add"]

print('***************************')
print(score(indata_aa, {}))&lt;/PRE&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eran&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 14:53:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/302739#M55991</guid>
      <dc:creator>eranraz1</dc:creator>
      <dc:date>2020-09-08T14:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/302760#M55992</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/20298"&gt;@eranraz1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found two issues with the code you posted:&lt;/P&gt;
&lt;P&gt;1) You provided a string as an input value for DESIGN_LAYERS. The scoring code expects a float, as stated in the getInputMetadata() method; the value should not be quoted.&lt;/P&gt;
&lt;PRE&gt;indata_aa =  {'DESIGN_LAYERS': '3','EXISTS_LASER_DRILL' : 'YES' } &lt;/PRE&gt;
&lt;P&gt;should be instead: &lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;indata_aa =  {'DESIGN_LAYERS': 3,'EXISTS_LASER_DRILL' : 'YES' } &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2) The return line at the end of the scoring method is missing an subscription so that the value is added to a dictionary element, not to the (output) dictionary itself. If this is the original generated code, it is a bug. Maybe it is a change introduced by mistake while creating the test script.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; outdata = 358.593374276362 + 26.8517927560789 * indata[u"DESIGN_LAYERS"] + _temp_0&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; outdata[u"Add"] = 358.593374276362 + 26.8517927560789 * indata[u"DESIGN_LAYERS"] + _temp_0&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With these changes, (and after adding a Numpy import statement) the script works and returns a result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;***************************
569.3520768491067
[Finished in 0.3s]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See attached for the complete, updated script.&lt;/P&gt;
&lt;P&gt;PS: Next time, it would be better to open a new discussion and refer back to this 2-year old post for context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 15:16:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/302760#M55992</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2020-09-08T15:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/302921#M56004</link>
      <description>&lt;P&gt;Thank you very much for the quick and detailed response ,&lt;/P&gt;&lt;P&gt;it's working great now&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Eran&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 20:56:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/302921#M56004</guid>
      <dc:creator>eranraz1</dc:creator>
      <dc:date>2020-09-08T20:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: error when run python code(created through JMP formula depot )</title>
      <link>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/367808#M61769</link>
      <description>&lt;P&gt;&lt;A href="http://net-informations.com/ds/pd/default.htm" target="_self"&gt;Pandas&lt;/A&gt; follows the numpy convention of raising an error when you try to convert something to a bool. This happens in a if or when using the boolean operations, and, or, or not. It is not clear what the result of.&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;5 == pd.Series([12,2,5,10])&lt;/P&gt;&lt;P&gt;The result you get is a Series of booleans, equal in size to the pd.Series in the right hand side of the expression. So, you get an error. The problem here is that you are comparing a pd.Series with a value, so you'll have multiple True and multiple False values, as in the case above. This of course is ambiguous, since the condition is neither True or False. You need to further aggregate the result so that a single boolean value results from the operation. For that you'll have to use either any or all depending on whether you want at least one (any) or all values to satisfy the condition.&lt;/P&gt;&lt;PRE&gt;(5 == pd.Series([12,2,5,10])).all()
# False&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE&gt;(5 == pd.Series([12,2,5,10])).any()
# True&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 09:59:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/error-when-run-python-code-created-through-JMP-formula-depot/m-p/367808#M61769</guid>
      <dc:creator>haviernick</dc:creator>
      <dc:date>2021-03-15T09:59:20Z</dc:date>
    </item>
  </channel>
</rss>

