示例#1
0
import pyximport; pyximport.install()

import memviews
import numpy as np
from array import array

arr = np.ones((10**6,), dtype=np.double)
print memviews.summer(arr)
# => 1000000.0

a = array('d', [1]*10**6)
print len(a)
# => 1000000

print memviews.summer(a)
# => 1000000.0
示例#2
0
import pyximport

pyximport.install()

import memviews
import numpy as np
from array import array

arr = np.ones((10**6, ), dtype=np.double)
print
memviews.summer(arr)
# => 1000000.0

a = array('d', [1] * 10**6)
print
len(a)
# => 1000000

print
memviews.summer(a)
# => 1000000.0
示例#3
0
import pyximport

pyximport.install()

import memviews
import numpy as np
from array import array

arr = np.ones((10**6, ), dtype=np.double)
print(memviews.summer(arr))
# => 1000000.0

a = array('d', [1] * 10**6)
print(len(a))
# => 1000000

print(memviews.summer(a))
# => 1000000.0
示例#4
0
import pyximport

pyximport.install()

import memviews
import numpy as np
from array import array

arr = np.ones((10 ** 6,), dtype=np.double)
print(memviews.summer(arr))
# => 1000000.0

a = array('d', [1] * 10 ** 6)
print(len(a))
# => 1000000

print(memviews.summer(a))
# => 1000000.0