File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 273273 " Converting Arrow data to columnar NumPy arrays is recommended to leverage the columnar nature of Arrow data. \n " ,
274274 " This conversion can be done with zero-copy operations.\n " ,
275275 " \n " ,
276- " A similar approach be adopted by the user to convert to row based data.\n " ,
277- " \n " ,
278- " ```{note}\n " ,
279- " The option of `zero_copy_only` in the function below and assert for correct dtype is added in this demo to verify no copies are made. \n " ,
280- " Its usage is not mandatory to do zero copy conversion.\n " ,
281- " ```"
276+ " A similar approach be adopted by the user to convert to row based data."
282277 ]
283278 },
284279 {
303298 " result = {}\n " ,
304299 " result_dtype = power_grid_meta_data[dataset_type][component_type].dtype\n " ,
305300 " for name, column in zip(data.column_names, data.columns):\n " ,
301+ " # The use of zero_copy_only=True and assert statement is to verify if no copies are made. \n " ,
302+ " # They are not mandatory for a zero-copy conversion.\n " ,
306303 " column_data = column.to_numpy(zero_copy_only=True)\n " ,
307304 " assert column_data.dtype == result_dtype[name]\n " ,
308305 " result[name] = column_data.astype(dtype=result_dtype[name], copy=False)\n " ,
813810 {
814811 "data" : {
815812 "text/plain" : [
816- " <pyarrow.lib.DoubleArray object at 0x0000020F64403820 >\n " ,
813+ " <pyarrow.lib.DoubleArray object at 0x000001C0F99C7AC0 >\n " ,
817814 " [\n " ,
818815 " 1,\n " ,
819816 " 0.01,\n " ,
You can’t perform that action at this time.
0 commit comments