Accessing Pandas library using IronPython
Asked Answered
F

1

8

I aim to connect Python to .NET for a process. I am using IronPython for it. The part in Python involves some calculations for which I use the Pandas library.

Is there a way to connect IronPython and Pandas?

I see using IronPython, I can access all the basic Python functionalities. How to extend this generally to access third party functionalities/packages (like Pandas here)?

Fumy answered 15/4, 2016 at 8:4 Comment(0)
B
22

Short answer: No. Longer answer: As far as I am aware tere is no way to integrate C-libraries with IronPython in the default python way. Since pandas / numpy use a heavy dose of c code, that is a showstopper.

We use Python.net for this task - basically we embed an python interpreter in .NET and retrieve the results of our computations. That works well and avoids the problems which arise due to IronPython. Furthermore, the "hosted" python process is 100% native, so no library problems should arise. There can be some problems with subprocesses, since the process is a daemon, but they can be circumvented.

Brew answered 15/4, 2016 at 8:12 Comment(2)
Great. Exploring on this. Quick question - no library problems means I can access any library as long as I have it in the Python's libraries folder?Fumy
Exactly. If you use Python.Net in Python you can even use .NET Libraries or data (we transfer pointers for example...) If you find this useful, please mark it as acceptedBrew

© 2022 - 2024 — McMap. All rights reserved.