Title: failure to convert numpy.float64 into System.Double · Issue #1936 · pythonnet/pythonnet · GitHub
Open Graph Title: failure to convert numpy.float64 into System.Double · Issue #1936 · pythonnet/pythonnet
X Title: failure to convert numpy.float64 into System.Double · Issue #1936 · pythonnet/pythonnet
Description: Environment Pythonnet version: 3.0 Python version: 3.x Operating System: Windows/Linux .NET Runtime: x Details Passing in a numpy array to a C# function that takes a double[] parameter fails. python code: test_array = np.array([123, 345]...
Open Graph Description: Environment Pythonnet version: 3.0 Python version: 3.x Operating System: Windows/Linux .NET Runtime: x Details Passing in a numpy array to a C# function that takes a double[] parameter fails. pytho...
X Description: Environment Pythonnet version: 3.0 Python version: 3.x Operating System: Windows/Linux .NET Runtime: x Details Passing in a numpy array to a C# function that takes a double[] parameter fails. pytho...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/1936
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"failure to convert numpy.float64 into System.Double","articleBody":"### Environment\r\n\r\n- Pythonnet version: 3.0\r\n- Python version: 3.x\r\n- Operating System: Windows/Linux\r\n- .NET Runtime: x\r\n\r\n### Details\r\n\r\nPassing in a numpy array to a C# function that takes a double[] parameter fails.\r\n\r\npython code:\r\n test_array = np.array([123, 345], np.float)\r\n CSharpClass.Test(test_array)\r\n\r\nC# code\r\n public static void Test(double[] TestData) {...}\r\n\r\nI already have a fix for this issue.\r\n\r\nIn Runtime.cs, change PyFloat_Check(...) to\r\n\r\n internal static bool PyFloat_Check(BorrowedReference ob)\r\n {\r\n return PyObject_TypeCheck(ob, PyFloatType);\r\n //return PyObject_TYPE(ob) == PyFloatType; // existing code\r\n }\r\n\r\nThis will convert any type that is derived from PyFloatType, which includes numpy.float64","author":{"url":"https://github.com/rzindler","@type":"Person","name":"rzindler"},"datePublished":"2022-09-12T21:01:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":24},"url":"https://github.com/1936/pythonnet/issues/1936"}
| 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:ab5316e6-0333-675a-19e9-1c3bc24706c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A7B6:2F377C:118C900:1773E92:69702DA0 |
| html-safe-nonce | d057a248cda1321436f8ebf9d699b398163c7911b3456980ebce4e51ec1ec4ce |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0I2OjJGMzc3QzoxMThDOTAwOjE3NzNFOTI6Njk3MDJEQTAiLCJ2aXNpdG9yX2lkIjoiNzA4NjA5NTQ3OTE4NjkyNzAwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 156d3124cbf7849271496a57c57712dc58f74ac3a5fba40b81b65470561bf07f |
| hovercard-subject-tag | issue:1370512471 |
| 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/1936/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3b50b0a97a734477739cd66c3d8ab6e5054738f172c1a7d04aa377e8cacc15ce/pythonnet/pythonnet/issues/1936 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3b50b0a97a734477739cd66c3d8ab6e5054738f172c1a7d04aa377e8cacc15ce/pythonnet/pythonnet/issues/1936 |
| og:image:alt | Environment Pythonnet version: 3.0 Python version: 3.x Operating System: Windows/Linux .NET Runtime: x Details Passing in a numpy array to a C# function that takes a double[] parameter fails. pytho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rzindler |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01fa379f5de85ef8e791d09724e69709ce9eb9595278316e0a921312dc88e0bc |
| 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 | dda91974c069382b0dfa47b2da7e28bd061c8331 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width