File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ PyDateTime_IMPORT
2828cdef extern from " Python.h" :
2929 int PySlice_Check(object )
3030
31-
3231def list_to_object_array (list obj ):
3332 '''
3433 Convert list to object ndarray. Seriously can't believe I had to write this
@@ -108,14 +107,12 @@ cdef class Int64Vector(Vector):
108107
109108 cdef inline void append(self , int64_t x) nogil:
110109
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()
116113
117- self .data[self .n] = x
118- self .n += 1
114+ self .data[self .n] = x
115+ self .n += 1
119116
120117cdef class Float64Vector(Vector):
121118
Original file line number Diff line number Diff line change 88from pandas.util.testing import test_parallel
99
1010N = 1000000
11- ngroups = 100
11+ ngroups = 1000
1212
1313def get_test_data(ngroups=100, n=N):
1414 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' )
1616
1717 if len(arr) < n:
1818 arr = np.asarray(list(arr) + unique_groups[:n - len(arr)],
19- dtype=object )
19+ dtype='int64' )
2020
2121 random.shuffle(arr)
2222 return arr
@@ -26,10 +26,8 @@ def get_test_data(ngroups=100, n=N):
2626 'data1' : np.random.randn(N),
2727 'data2' : np.random.randn(N)})
2828
29- grp = df.groupby('key1')['data1']
30-
3129def f():
32- grp .sum()
30+ df.groupby('key1')['data1'] .sum()
3331
3432# run consecutivily
3533def g2():
You can’t perform that action at this time.
0 commit comments