我使用的是MySQLdb和Python。我有一些基本的查询,比如:c.execute("SELECT id, rating from video")我需要"results“是一个NumPy数组,并且我希望节省内存消耗。有没有更好的方法将MySQLdb查询结果转换为NumPy数组格式?我之所以希望使用NumPy数组格式,是因为我希望能够轻松
我有过 int[,,,] arr = new int[5, 6, 7, 8]; // c#
arr = np.zeros((5, 6, 7, 8)) # Python 具有5 * 6 * 7 * 8单元的我想把它切成c#,就像numpy那样 var mySlice = arr[2:4, 0, :2, :]; // Won't work in C#, but looking for a way to doshould be int[,,] A 3d array with 2 * 1 * 2 * 8 cells.