I have a simple python script file which contains following 3 statements:

import pandas
df = pandas.read_csv('testfile.csv')
print(df[0:3])

Can I incorporate above in a D program?
I see there is pyd package for using python in D: https://code.dlang.org/packages/pyd
Will following program work:


import std.stdio;
import pyd.embedded;

void main(){
        py_import("pandas");
        py_stmts("df = pandas.read_csv('testfile.csv')");     
        py_stmts("print(df[0:3])");
}

Thanks for your insight.

Reply via email to