File tree 2 files changed +9
-14
lines changed
2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ PyDateTime_IMPORT
28
28
cdef extern from " Python.h" :
29
29
int PySlice_Check(object )
30
30
31
-
32
31
def list_to_object_array (list obj ):
33
32
'''
34
33
Convert list to object ndarray. Seriously can't believe I had to write this
@@ -108,14 +107,12 @@ cdef class Int64Vector(Vector):
108
107
109
108
cdef inline void append(self , int64_t x) nogil:
110
109
111
- with nogil:
112
-
113
- if self .needs_resize():
114
- with gil:
115
- self .resize()
110
+ if self .needs_resize():
111
+ with gil:
112
+ self .resize()
116
113
117
- self .data[self .n] = x
118
- self .n += 1
114
+ self .data[self .n] = x
115
+ self .n += 1
119
116
120
117
cdef class Float64Vector(Vector):
121
118
Original file line number Diff line number Diff line change 8
8
from pandas.util.testing import test_parallel
9
9
10
10
N = 1000000
11
- ngroups = 100
11
+ ngroups = 1000
12
12
13
13
def get_test_data(ngroups=100, n=N):
14
14
unique_groups = range(ngroups)
15
- arr = np.asarray(np.tile(unique_groups, n / ngroups), dtype=object )
15
+ arr = np.asarray(np.tile(unique_groups, n / ngroups), dtype='int64' )
16
16
17
17
if len(arr) < n:
18
18
arr = np.asarray(list(arr) + unique_groups[:n - len(arr)],
19
- dtype=object )
19
+ dtype='int64' )
20
20
21
21
random.shuffle(arr)
22
22
return arr
@@ -26,10 +26,8 @@ def get_test_data(ngroups=100, n=N):
26
26
'data1' : np.random.randn(N),
27
27
'data2' : np.random.randn(N)})
28
28
29
- grp = df.groupby('key1')['data1']
30
-
31
29
def f():
32
- grp .sum()
30
+ df.groupby('key1')['data1'] .sum()
33
31
34
32
# run consecutivily
35
33
def g2():
You can’t perform that action at this time.
0 commit comments