ironpython

Can we load pandas DataFrame in .NET ironpython?

荒凉一梦 提交于 2019-12-04 20:09:45
问题 Can we load a pandas DataFrame in .NET space using iron python? If not I am thinking of converting pandas df into a csv file and then reading in .net space. 回答1: No, Pandas is pretty well tied to CPython. Like you said, your best bet is to do the analysis in CPython with Pandas and export the result to CSV. 回答2: Regarding the option including serialization: I'm still investigating similar case - we want to process the data in python and then use the results in c#. Our requirement was to

Export Datatables from Spotfire to CSV using IronPython Script

牧云@^-^@ 提交于 2019-12-04 19:35:28
I have a IronPython script I use to export all my data tables from a Spotfire project. Currently it works perfectly. It loops through all datatables and exports them as ".xlsx". Now I need to export the files as ".csv" which I thought would be as simple as changing ".xlsx" to ".csv". This script still exports the files, names them all .csv, but what is inside the file is a .xlsx, Im not sure how or why. The code is just changing the file extension name but not converting the file to csv. Here is the code I am currently using: I have posted the full code at the bottom, and the code I believe is

How do I install IronPython 2.0 with NGEN'ed binaries?

坚强是说给别人听的谎言 提交于 2019-12-04 17:38:09
Does anyone know how to install IronPython 2.0 with NGEN'ed binaries using the MSI package? The official IronPython homepage says that the NGEN option will greatly improve startup time, but for some reason it is not enabled by default. It doesn't actually state which MSI parameters you need pass to enable it, and I couldn't find a documentation page on the site, so I'm hoping someone here would know. (Clarification: I'm doing a silent install for distribution to multiple machines, so I'm looking for command line parameters, thanks) I'm asking this because the start time for a simple "hello

Call dll function works in IronPython, doesn't work in CPython3.4 gives “No method matches given arguments” error

烂漫一生 提交于 2019-12-04 16:34:06
For a project I need to include a DLL in Python. I'm using CPython3.4 and for including the dll I use pythonnet clr module (pythonnet-2.0.0.dev1-cp34-none-win_amd64.whl). In the dll I need a function that gives me a continuous update of a measurement. The dll is written in VB.net, the function that I need is shown below: Public Sub AdviseStart(ByVal item As Integer, ByVal a As Action(Of Object)) Implements IConversation.AdviseStart _parameterPoller.RegisterCallback(item, a) End Sub This is the code that I have written in python to call this function: import clr clr.AddReference('dll name')

Ironpython call numpy problem

天大地大妈咪最大 提交于 2019-12-04 16:19:37
Ironpython 2.6, python 2.6.5, numpy, SciPy import sys sys.path.append(r'D:\Python26\dll') sys.path.append(r'D:\Python26\Lib') sys.path.append(r'D:\Python26\Lib\site-packages') » import numpy Traceback (most recent call last): File "", line 1, in File "D:\Python26\Lib\site-packages\numpy\__init__.py", line 132, in File "D:\Python26\Lib\site-packages\numpy\add_newdocs.py", line 9, in File "D:\Python26\Lib\site-packages\numpy\lib\__init__.py", line 4, in File "D:\Python26\Lib\site-packages\numpy\lib\type_check.py", line 8, in File "D:\Python26\Lib\site-packages\numpy\core\__init__.py", line 5, in

IronPython Webframework

匆匆过客 提交于 2019-12-04 16:05:39
问题 There seem to be many excellent web frameworks for Python. Has anyone used any of these (Pylons, Web2Py, Django) with IronPython? 回答1: Django has been run on IronPython before, but as a proof-of-concept. I know the IronPython team are interested in Django support as a metric for Python-compatibility. Somewhat related is the possibility to use IronPython with ASP.NET and ASP.NET MVC, which is probably more mature. 回答2: You may want to read this Basically web2py code runs unmodified and out of

Import scikit in C# application

ε祈祈猫儿з 提交于 2019-12-04 15:12:24
I am trying to import scikit-learn in a C# (console) application. I am using Python Tools for Visual Studio and IronPython 2.7.3. I managed to run an external python script and I also managed to import numpy by declaring the python path: "C:\Python27\Lib\site-packages\" However, when it comes to scikit-learn I get an error message: Oops! We couldn't execute the script because of an exception: No module named _c heck_build ___________________________________________________________________________ Contents of C:\Python27\Lib\site-packages\sklearn\__check_build: setup.py setup.pyc setup.pyo

Is there any way to debug Python code embedded in C# with Visual Studio and PTVS?

时光毁灭记忆、已成空白 提交于 2019-12-04 14:37:45
I've created the code to embed IronPython code in C# public ScriptEngine GetEngine() { if( _engine != null ) return _engine; _engine = Python.CreateEngine(); var paths = _engine.GetSearchPaths(); paths.Add( _pythonPath ); _engine.SetSearchPaths( paths ); var runtime = _engine.Runtime; runtime.LoadAssembly( typeof( CharacterCore ).Assembly ); return _engine; } public IAbility Movement() { var engine = GetEngine(); var script = engine.CreateScriptSourceFromFile( Path.Combine( _pythonPath, "movement.py" ) ); var code = script.Compile(); var scope = engine.CreateScope(); code.Execute( scope );

Cpython interpretter / IronPython interpretter No module named clr

强颜欢笑 提交于 2019-12-04 14:11:18
问题 i'm using IronPython and i want to create some windows form, i want to create a windows form with some button, and i want to do this in visual studio with iron python, i'm using visual studio 2012 integrated edition, each time i create an "ironpython windows form" project, when i want to run it, it says: The project is currently set to use the .NET debugger for IronPython debugging but the project is configured to start with a CPython interpreter. To fix this change the debugger type in

IronPython cannot import module “os”

[亡魂溺海] 提交于 2019-12-04 13:47:19
问题 my c# code: //Create the ScriptRuntime engine = Python.CreateEngine(); //Create the scope for the ScriptEngine scope = engine.CreateScope(); string pyfile = "D:\\MyAddin\\test.py"; ScriptSource source = engine.CreateScriptSourceFromFile(pyfile); var rt = source.Execute(scope); and my test.py: import os import sys ... print("test") ... I get no problem at build time, but at runtime VS give me a error "cannot import module "os"". Where is the error? 回答1: When hosting IronPython in your code,