@@ -172,15 +172,19 @@ def time_to_json(self, orient, frame):
172
172
def peakmem_to_json (self , orient , frame ):
173
173
getattr (self , frame ).to_json (self .fname , orient = orient )
174
174
175
- def time_to_json_wide (self , orient , frame ):
175
+
176
+ class ToJSONWide (ToJSON ):
177
+ def setup (self , orient , frame ):
178
+ super ().setup (orient , frame )
176
179
base_df = getattr (self , frame ).copy ()
177
- df = concat ([base_df .iloc [:100 ]] * 1000 , ignore_index = True , axis = 1 )
178
- df .to_json (self .fname , orient = orient )
180
+ df_wide = concat ([base_df .iloc [:100 ]] * 1000 , ignore_index = True , axis = 1 )
181
+ self .df_wide = df_wide
182
+
183
+ def time_to_json_wide (self , orient , frame ):
184
+ self .df_wide .to_json (self .fname , orient = orient )
179
185
180
186
def peakmem_to_json_wide (self , orient , frame ):
181
- base_df = getattr (self , frame ).copy ()
182
- df = concat ([base_df .iloc [:100 ]] * 1000 , ignore_index = True , axis = 1 )
183
- df .to_json (self .fname , orient = orient )
187
+ self .df_wide .to_json (self .fname , orient = orient )
184
188
185
189
186
190
class ToJSONISO (BaseIO ):
0 commit comments