Skip to content

Commit 855d196

Browse files
committed
address comment
Signed-off-by: Nitish Bharambe <[email protected]>
1 parent 720c9d6 commit 855d196

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

docs/examples/arrow_example.ipynb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,7 @@
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
{
@@ -303,6 +298,8 @@
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",
@@ -813,7 +810,7 @@
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",

0 commit comments

Comments
 (0)