using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IronPython.Hosting;
using Microsoft.Scripting.Hosting;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
var var1 = 0;
var var2 = 0;
ScriptEngine engine = Python.CreateEngine();
ScriptScope scope = engine.CreateScope();
var searchPaths = engine.GetSearchPaths();
searchPaths.Add(@"C:\Users\humay\AppData\Local\Programs\Python\Python310");
engine.ExecuteFile(@"C:\Users\humay\Downloads\python.py", scope);
dynamic testFunction = scope.GetVariable("test_func");
var result = testFunction(var1, var2);
}
}
}```
**Python**
import pandas as pd
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, confusion_matrix
from sklearn.preprocessing import StandardScaler
def test_func(var1, var2):
dataset = pd.read_csv('iris.csv')
X = dataset.drop(columns=['Species'])
y = dataset['Species']
X_train, X_test, y_train, y_test = train_test_split(X,y, test_size =0.2)
sc = StandardScaler()
X_train = sc.fit_transform(X_train)
X_test = sc.fit_transform(X_test)
classifier = GaussianNB()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
print(y_pred)
# cm = confusion_matrix(y_test, y_pred)
# ac = accuracy_score(y_test, y_pred)```
When I run the c# code, I get the error :"No module named pandas". I have ran "pip install pandas" and its still not working. I am trying to write bayesian classifier python code and run it in my project in asp.net