{"id":8412,"date":"2018-09-23T11:37:05","date_gmt":"2018-09-23T11:37:05","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=8412"},"modified":"2018-09-23T11:59:55","modified_gmt":"2018-09-23T11:59:55","slug":"python-numpy","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=8412","title":{"rendered":"Python numpy"},"content":{"rendered":"<h2>seed<\/h2>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/21494489\/what-does-numpy-random-seed0-do\">What does numpy.random.seed(0) do?<\/a><\/p>\n<h2>choice<\/h2>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/43664994\/numpy-random-choice-vs-random-choice\">numpy.random.choice vs random.choice<\/a><\/p>\n<h2>ndarray<\/h2>\n<p><a href=\"https:\/\/docs.scipy.org\/doc\/numpy-1.15.0\/reference\/arrays.html\">Array objects<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/15879315\/what-is-the-difference-between-ndarray-and-array-in-numpy\">What is the difference between ndarray and array in numpy?<\/a><\/p>\n<h4>C Implementation<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/2497790\/python-overriding-class-not-instance-special-methods\">Python overriding class (not instance) special methods<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/28295674\/define-python-class-from-c\">Define Python class from C<\/a><\/p>\n<pre class=\"brush: plain; title: numpy\/core\/src\/multiarray\/arrayobjects.c; notranslate\" title=\"numpy\/core\/src\/multiarray\/arrayobjects.c\">\r\nNPY_NO_EXPORT PyTypeObject PyArray_Type = {\r\n    PyObject_HEAD_INIT(NULL)\r\n    0,                                          \/* ob_size *\/\r\n    &quot;numpy.ndarray&quot;,                            \/* tp_name *\/\r\n    &#x5B;...]\r\n    (reprfunc)array_repr,                       \/* tp_repr *\/\r\n    &#x5B;...]\r\n    (reprfunc)array_str,                        \/* tp_str *\/\r\n    (getattrofunc)0,                            \/* tp_getattro *\/\r\n    (setattrofunc)0,                            \/* tp_setattro *\/\r\n    &#x5B;...]\r\n    (getiterfunc)array_iter,                    \/* tp_iter *\/\r\n    (iternextfunc)0,                            \/* tp_iternext *\/\r\n    array_methods,                              \/* tp_methods *\/\r\n    0,                                          \/* tp_members *\/\r\n    array_getsetlist,                           \/* tp_getset *\/\r\n    &#x5B;...]\r\n    (initproc)0,                                \/* tp_init *\/\r\n    (allocfunc)array_alloc,                     \/* tp_alloc *\/\r\n    (newfunc)array_new,                         \/* tp_new *\/\r\n    (freefunc)array_free,                       \/* tp_free *\/\r\n    &#x5B;...]\r\n};\r\n<\/pre>\n<pre class=\"brush: plain; title: numpy\/core\/src\/multiarray\/strfuncs.c; notranslate\" title=\"numpy\/core\/src\/multiarray\/strfuncs.c\">\r\nNPY_NO_EXPORT PyObject *\r\narray_str(PyArrayObject *self)\r\n{\r\n   &#x5B;...]\r\n}\r\n\r\nstatic int\r\ndump_data(...)\r\n{\r\n   &#x5B;...]\r\n}\r\n<\/pre>\n<h4>String<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/44725984\/converting-a-numpy-ndarray-to-string\">Converting a numpy.ndarray to string<\/a><br \/>\n<a href=\"https:\/\/docs.scipy.org\/doc\/numpy-1.14.0\/reference\/generated\/numpy.array2string.html\">numpy.array2string<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>seed What does numpy.random.seed(0) do? choice numpy.random.choice vs random.choice ndarray Array objects What is the difference between ndarray and array in numpy? C Implementation Python overriding class (not instance) special methods Define Python class from C NPY_NO_EXPORT PyTypeObject PyArray_Type = { PyObject_HEAD_INIT(NULL) 0, \/* ob_size *\/ &quot;numpy.ndarray&quot;, \/* tp_name *\/ &#x5B;&#8230;] (reprfunc)array_repr, \/* tp_repr *\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8412","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/8412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8412"}],"version-history":[{"count":3,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/8412\/revisions"}],"predecessor-version":[{"id":8417,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/8412\/revisions\/8417"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}