フィルターのクリア

how to pass the matlab data to python to create a csc sparse matrix

8 ビュー (過去 30 日間)
Pengfei Li
Pengfei Li 2018 年 9 月 11 日
hello,
I want to pass the matlab data to python to create a csc sparse matrix using python language in matlab. now I met a problem, can you help me? Thank you very much. my code in matlab as follow, I met the data type problem.
iK=[0 2 2 0 1 2];
jK=[0 0 1 2 2 2];
sK=[1 2 3 4 5 6];
data=py.numpy.array(sK);
ir=py.numpy.array(iK);
jr=py.numpy.array(jK);
A = py.scipy.sparse.csc_matrix(data,ir,jr);
when I came to create the csc_matrix, then python would tell me the data type is not right. could you help me correct it? thank you very much.
  1 件のコメント
Alec Jacobson
Alec Jacobson 2021 年 3 月 28 日
http://www.alecjacobson.com/weblog/?p=4899

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by