Title: Use .T instead of np.transpose() for better performance and readability · Issue #83 · PPPLDeepLearning/plasma-python · GitHub
Open Graph Title: Use .T instead of np.transpose() for better performance and readability · Issue #83 · PPPLDeepLearning/plasma-python
X Title: Use .T instead of np.transpose() for better performance and readability · Issue #83 · PPPLDeepLearning/plasma-python
Description: plasma-python/data/gadata.py Line 77 in b13dbed self.ydata = numpy.transpose(self.ydata) In the following code: if numpy.ndim(self.ydata) == 2: self.ydata = numpy.transpose(self.ydata) it's better to replace np.transpose() with the short...
Open Graph Description: plasma-python/data/gadata.py Line 77 in b13dbed self.ydata = numpy.transpose(self.ydata) In the following code: if numpy.ndim(self.ydata) == 2: self.ydata = numpy.transpose(self.ydata) it's better ...
X Description: plasma-python/data/gadata.py Line 77 in b13dbed self.ydata = numpy.transpose(self.ydata) In the following code: if numpy.ndim(self.ydata) == 2: self.ydata = numpy.transpose(self.ydata) it's bet...
Opengraph URL: https://github.com/PPPLDeepLearning/plasma-python/issues/83
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use .T instead of np.transpose() for better performance and readability","articleBody":"https://github.com/PPPLDeepLearning/plasma-python/blob/b13dbed1883730d971dfe87fc1bc44e368840083/data/gadata.py#L77\nIn the following code:\n`if numpy.ndim(self.ydata) == 2:\n self.ydata = numpy.transpose(self.ydata)\n`\nit's better to replace np.transpose() with the shorthand .T:\n`if numpy.ndim(self.ydata) == 2:\n self.ydata = self.ydata.T\n`\nBoth versions produce the same result for 2D arrays, but .T is more efficient as it directly accesses the array’s transpose property without invoking a function call. It also improves code clarity and conforms to standard NumPy coding practices.","author":{"url":"https://github.com/SaFE-APIOpt","@type":"Person","name":"SaFE-APIOpt"},"datePublished":"2025-03-18T08:53:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/83/plasma-python/issues/83"}
| 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:1b3169c1-36d9-8832-736e-da5262795561 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA82:6D18D:A8D6C:E9FA0:698E1218 |
| html-safe-nonce | 64c0715a18207ff2a0e249b0d0e70425f36638d1413d11e6068683a58b5cc976 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTgyOjZEMThEOkE4RDZDOkU5RkEwOjY5OEUxMjE4IiwidmlzaXRvcl9pZCI6IjE3ODA3MTEyODI3NDUwNjI2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8d97d47c0d9ae887a1845a3f3079522be8bde30a41e1ad180f354ba35db5c7b5 |
| hovercard-subject-tag | issue:2927662650 |
| 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/PPPLDeepLearning/plasma-python/83/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f2f87f08b7d9624b4f5b72df4582cab724be659865eea5c7c1ce077a692de95f/PPPLDeepLearning/plasma-python/issues/83 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f2f87f08b7d9624b4f5b72df4582cab724be659865eea5c7c1ce077a692de95f/PPPLDeepLearning/plasma-python/issues/83 |
| og:image:alt | plasma-python/data/gadata.py Line 77 in b13dbed self.ydata = numpy.transpose(self.ydata) In the following code: if numpy.ndim(self.ydata) == 2: self.ydata = numpy.transpose(self.ydata) it's better ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SaFE-APIOpt |
| hostname | github.com |
| expected-hostname | github.com |
| None | fdf74c91c9ac187cc5cd7b14d4af2d6ef3e18136d002f5d36253f8538e97ee4c |
| turbo-cache-control | no-preview |
| go-import | github.com/PPPLDeepLearning/plasma-python git https://github.com/PPPLDeepLearning/plasma-python.git |
| octolytics-dimension-user_id | 23219101 |
| octolytics-dimension-user_login | PPPLDeepLearning |
| octolytics-dimension-repository_id | 72968591 |
| octolytics-dimension-repository_nwo | PPPLDeepLearning/plasma-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 72968591 |
| octolytics-dimension-repository_network_root_nwo | PPPLDeepLearning/plasma-python |
| 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 | 1a5a3e7bbfb3486980e340c242368684156fba87 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width