1
+ import sys
2
+
1
3
import numpy as np
2
4
3
5
from pandas import DataFrame , concat , date_range , read_json , timedelta_range
@@ -82,6 +84,7 @@ def setup(self, orient, frame):
82
84
timedeltas = timedelta_range (start = 1 , periods = N , freq = "s" )
83
85
datetimes = date_range (start = 1 , periods = N , freq = "s" )
84
86
ints = np .random .randint (100000000 , size = N )
87
+ longints = sys .maxsize * np .random .randint (100000000 , size = N )
85
88
floats = np .random .randn (N )
86
89
strings = tm .makeStringIndex (N )
87
90
self .df = DataFrame (np .random .randn (N , ncols ), index = np .arange (N ))
@@ -120,6 +123,18 @@ def setup(self, orient, frame):
120
123
index = index ,
121
124
)
122
125
126
+ self .df_longint_float_str = DataFrame (
127
+ {
128
+ "longint_1" : longints ,
129
+ "longint_2" : longints ,
130
+ "float_1" : floats ,
131
+ "float_2" : floats ,
132
+ "str_1" : strings ,
133
+ "str_2" : strings ,
134
+ },
135
+ index = index ,
136
+ )
137
+
123
138
def time_to_json (self , orient , frame ):
124
139
getattr (self , frame ).to_json (self .fname , orient = orient )
125
140
@@ -172,6 +187,7 @@ def setup(self):
172
187
timedeltas = timedelta_range (start = 1 , periods = N , freq = "s" )
173
188
datetimes = date_range (start = 1 , periods = N , freq = "s" )
174
189
ints = np .random .randint (100000000 , size = N )
190
+ longints = sys .maxsize * np .random .randint (100000000 , size = N )
175
191
floats = np .random .randn (N )
176
192
strings = tm .makeStringIndex (N )
177
193
self .df = DataFrame (np .random .randn (N , ncols ), index = np .arange (N ))
@@ -209,6 +225,17 @@ def setup(self):
209
225
},
210
226
index = index ,
211
227
)
228
+ self .df_longint_float_str = DataFrame (
229
+ {
230
+ "longint_1" : longints ,
231
+ "longint_2" : longints ,
232
+ "float_1" : floats ,
233
+ "float_2" : floats ,
234
+ "str_1" : strings ,
235
+ "str_2" : strings ,
236
+ },
237
+ index = index ,
238
+ )
212
239
213
240
def time_floats_with_int_idex_lines (self ):
214
241
self .df .to_json (self .fname , orient = "records" , lines = True )
@@ -225,6 +252,9 @@ def time_float_int_lines(self):
225
252
def time_float_int_str_lines (self ):
226
253
self .df_int_float_str .to_json (self .fname , orient = "records" , lines = True )
227
254
255
+ def time_float_longint_str_lines (self ):
256
+ self .df_longint_float_str .to_json (self .fname , orient = "records" , lines = True )
257
+
228
258
229
259
class ToJSONMem :
230
260
def setup_cache (self ):
0 commit comments