Title: Numpy array to C# array · Issue #564 · pythonnet/pythonnet · GitHub
Open Graph Title: Numpy array to C# array · Issue #564 · pythonnet/pythonnet
X Title: Numpy array to C# array · Issue #564 · pythonnet/pythonnet
Description: Environment Pythonnet version: 2.4.0 Python version: 3.6 (anaconda) Operating System: Windows 7 (x86) Details I am using the code below to use some of the features of pylinac in C#. I would like to know how to convert the dynamic array i...
Open Graph Description: Environment Pythonnet version: 2.4.0 Python version: 3.6 (anaconda) Operating System: Windows 7 (x86) Details I am using the code below to use some of the features of pylinac in C#. I would like to...
X Description: Environment Pythonnet version: 2.4.0 Python version: 3.6 (anaconda) Operating System: Windows 7 (x86) Details I am using the code below to use some of the features of pylinac in C#. I would like to...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/564
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Numpy array to C# array","articleBody":"### Environment\r\n\r\n- Pythonnet version: 2.4.0\r\n- Python version: 3.6 (anaconda)\r\n- Operating System: Windows 7 (x86)\r\n\r\n### Details\r\n\r\nI am using the code below to use some of the features of pylinac in C#. I would like to know how to convert the dynamic array in to a C# array. In the example below the array structure is 60 rows and 4000 columns.\r\n\r\n{[[ 0. 0. 0. ..., 0. 0. 0.]\r\n [ 0. 0. 0. ..., 0. 0. 0.]\r\n [ 0. 0. 0. ..., 0. 0. 0.]\r\n ..., \r\n [ 0. 0. 0. ..., 0. 0. 0.]\r\n [ 0. 0. 0. ..., 0. 0. 0.]\r\n [ 0. 0. 0. ..., 0. 0. 0.]]}\r\n\r\n\r\n `PythonEngine.PythonHome = @\"C:\\Anaconda3\";\r\n \r\n using (Py.GIL())\r\n {\r\n try\r\n {\r\n dynamic pl = Py.Import(\"pylinac\");\r\n dynamic np = Py.Import(\"numpy\");\r\n dynamic tlog = pl.TrajectoryLog.from_demo();\r\n tlog.fluence.gamma.calc_map();\r\n dynamic array = tlog.fluence.actual.array.astype(np.float32, Py.kw(\"copy\", false));\r\n \r\n }\r\n catch (Exception ex)\r\n {\r\n MessageBox.Show(ex.ToString());\r\n }\r\n }`\r\n\r\nAlso when debugging in VS 2017 the process slows down when importing Py.Import(\"pylinac\"), any ideas, should this be in a separate post?","author":{"url":"https://github.com/bobred","@type":"Person","name":"bobred"},"datePublished":"2017-10-25T08:56:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/564/pythonnet/issues/564"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:593622f8-d878-d636-acba-39312a6b5fca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B980:341B16:D030CD:124A824:69722A34 |
| html-safe-nonce | 949311e817b32f5817f4f28e285cc230dc3583a142bbc7fda0a89a61160aae03 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTgwOjM0MUIxNjpEMDMwQ0Q6MTI0QTgyNDo2OTcyMkEzNCIsInZpc2l0b3JfaWQiOiI4NTMyNTQ0MTAyNTkzNjA0MTQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9fc4a587fc1648f1bba32f7be01febb062934789da061c19058b685d1e2b69ce |
| hovercard-subject-tag | issue:268317181 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonnet/pythonnet/564/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7afec51fac811e74e08286b2192265ffb0b89b05034cc002f41237d7b15ea443/pythonnet/pythonnet/issues/564 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7afec51fac811e74e08286b2192265ffb0b89b05034cc002f41237d7b15ea443/pythonnet/pythonnet/issues/564 |
| og:image:alt | Environment Pythonnet version: 2.4.0 Python version: 3.6 (anaconda) Operating System: Windows 7 (x86) Details I am using the code below to use some of the features of pylinac in C#. I would like to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bobred |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19a0eb237b419e41a3d6a0867abebfdb845544063fc287c8c486f2fc019a590f |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 805f05ae5b701e06271d4ccfc0cbb6252b8b2c21 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width