Title: Concat behaviour differs significantly from pandas (column order dependent) · Issue #641 · javascriptdata/danfojs · GitHub
Open Graph Title: Concat behaviour differs significantly from pandas (column order dependent) · Issue #641 · javascriptdata/danfojs
X Title: Concat behaviour differs significantly from pandas (column order dependent) · Issue #641 · javascriptdata/danfojs
Description: Describe the bug DataFrame creation is column order dependent, unlike Pandas Definition of an Object from ECMAScript Third Edition (pdf): 4.3.3 Object An object is a member of the type Object. It is an unordered collection of properties ...
Open Graph Description: Describe the bug DataFrame creation is column order dependent, unlike Pandas Definition of an Object from ECMAScript Third Edition (pdf): 4.3.3 Object An object is a member of the type Object. It i...
X Description: Describe the bug DataFrame creation is column order dependent, unlike Pandas Definition of an Object from ECMAScript Third Edition (pdf): 4.3.3 Object An object is a member of the type Object. It i...
Opengraph URL: https://github.com/javascriptdata/danfojs/issues/641
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Concat behaviour differs significantly from pandas (column order dependent)","articleBody":"**Describe the bug**\r\n\r\nDataFrame creation is column order dependent, unlike Pandas\r\n\r\n\u003e Definition of an Object from [ECMAScript Third Edition (pdf)](http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%203rd%20edition,%20December%201999.pdf):\r\n\r\n\u003e 4.3.3 Object\r\nAn object is a member of the type Object. It is an **unordered** collection of properties each of which contains a primitive value, object, or function. A function stored in a property of an object is called a method.\r\n\r\n**To Reproduce**\r\n\r\nDanfo.js v1.1.2\r\n\r\n```\r\nconst json_data_3d = [\r\n { campaignId: \"toyota\", agentId: \"bob\", metricValue: 1, metricId: \"callCount\" },\r\n { campaignId: \"toyota\", agentId: \"jim\", metricValue: 2, metricId: \"callCount\" },\r\n { campaignId: \"sony\", agentId: \"ben\", metricValue: 3, metricId: \"callCount\" },\r\n { campaignId: \"sony\", agentId: \"karl\", metricId: \"callCount\", metricValue: 4,},\r\n];\r\nconst dfone = new dfd.DataFrame(json_data_3d);\r\ndfone.print()\r\n╔════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╗\r\n║ │ campaignId │ agentId │ metricValue │ metricId ║\r\n╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢\r\n║ 0 │ toyota │ bob │ 1 │ callCount ║\r\n╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢\r\n║ 1 │ toyota │ jim │ 2 │ callCount ║\r\n╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢\r\n║ 2 │ sony │ ben │ 3 │ callCount ║\r\n╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢\r\n║ 3 │ sony │ karl │ callCount │ 4 ║\r\n╚════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╝\r\n```\r\n**Expected behavior**\r\n\r\n```\r\nimport pandas as pd\r\n\r\nconst json_data_3d = [\r\n { campaignId: \"toyota\", agentId: \"bob\", metricValue: 1, metricId: \"callCount\" },\r\n { campaignId: \"toyota\", agentId: \"jim\", metricValue: 2, metricId: \"callCount\" },\r\n { campaignId: \"sony\", agentId: \"ben\", metricValue: 3, metricId: \"callCount\" },\r\n { campaignId: \"sony\", agentId: \"karl\", metricValue: 4, metricId: \"callCount\" },\r\n];\r\nconst dfone = new dfd.DataFrame(json_data_3d);)\r\nprint(dfone)\r\n campaignId agentId metricValue metricId\r\n0 toyota bob 1 callCount\r\n1 toyota jim 2 callCount\r\n2 sony ben 3 callCount\r\n3 sony karl 4 callCount\r\n```","author":{"url":"https://github.com/bml1g12","@type":"Person","name":"bml1g12"},"datePublished":"2024-05-02T05:32:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/641/danfojs/issues/641"}
| 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:783ae041-45cf-59d5-9fee-55049277e9d7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF88:61B68:81739:B4CF8:6964F0EF |
| html-safe-nonce | 12236819045e5cac0078d5fa26c2f0cfcacec0c05d3d06e8ff27bb9ad45aa2a4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjg4OjYxQjY4OjgxNzM5OkI0Q0Y4OjY5NjRGMEVGIiwidmlzaXRvcl9pZCI6IjI3NjQwNDM2NDY5NzEyMTIwMTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 74bc687d355801f905456e9e76c71c8d14b26d851952136e4b0683a5be381f6d |
| hovercard-subject-tag | issue:2274644603 |
| 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/javascriptdata/danfojs/641/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a533474f6b54306dfd020de70e5023e42ca8827b6612c6ba37c9321d79cdd724/javascriptdata/danfojs/issues/641 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a533474f6b54306dfd020de70e5023e42ca8827b6612c6ba37c9321d79cdd724/javascriptdata/danfojs/issues/641 |
| og:image:alt | Describe the bug DataFrame creation is column order dependent, unlike Pandas Definition of an Object from ECMAScript Third Edition (pdf): 4.3.3 Object An object is a member of the type Object. It i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bml1g12 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 53cd8ae9b65b7c4a0ad545ffeb3216839259a92733857ba426906c0655c5419d |
| turbo-cache-control | no-preview |
| go-import | github.com/javascriptdata/danfojs git https://github.com/javascriptdata/danfojs.git |
| octolytics-dimension-user_id | 62061637 |
| octolytics-dimension-user_login | javascriptdata |
| octolytics-dimension-repository_id | 263751330 |
| octolytics-dimension-repository_nwo | javascriptdata/danfojs |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 263751330 |
| octolytics-dimension-repository_network_root_nwo | javascriptdata/danfojs |
| 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 | c140758368c0a01881f61b83770bd75cfe81e2c4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width