Python or C# for data science project API?

AMROUN Lysa 241 Reputation points
2023-05-15T09:14:21.0666667+00:00

Hello everyone,

I am a Data Science professional and I work on developing and training models for various projects such as NLP and forecasting, using Python. My final models are usually saved as pickle or onnx files, depending on the requirements. Currently, we use these models in .NET and C# APIs, which requires us to use models in ONNX format to integrate them into these APIs.

We are wondering if it would be better to switch to Python for the API and handle everything on both the template side and the API side. I'd like to know what the best technology solution is in this case, between continuing to use .NET C# for the API or switching to Python. I would also like to know the community's opinion on this topic and why one technology would be better than another.

I thank you in advance for your help.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,417 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,648 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
318 questions
0 comments No comments
{count} votes

Accepted answer
  1. XuDong Peng-MSFT 10,341 Reputation points Microsoft Vendor
    2023-05-16T06:46:22.4033333+00:00

    Hi @AMROUN Lysa,

    I'm afraid I can't say what the best solution is because it depends on many factors, the most important of which I think is based on your requirement.

    As you mentioned, the model format you are using is ONNX, and it also supports C#. If you have already used .NET for development, it will be a good choice to continue to use the existing environment, this will maintain the consistency of the technology stack used.

    And in my opinion, they both have a good ecosystem, and the additional libraries or tools you may use will depend on your end purpose.

    Best regards,

    Xudong Peng


    If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,731 Reputation points
    2023-05-15T17:21:57.1066667+00:00

    unless the model api is a web service, then you need to produce one for each language/platform you wish to support. this choice would be by the users of the api. also what else is the code doing?

    0 comments No comments