且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

相当于Matlab textscan的Python

更新时间:2022-03-13 16:29:14

如果要将Matlab转换为Python,我假设您已经在使用NumPy.

If you're translating Matlab to Python, I'll assume you're already using NumPy.

在这种情况下,您可以使用 np.loadtxt (如果没有缺少任何值)或

In that case, you can use np.loadtxt (if no values are missing) or np.genfromtxt (if there are missing values: I'm not sure whether Matlab's textscan handles that).

如果需要更多帮助,请给我们更多详细信息!

Give us a few more details if you need more help!