{"id":30669036,"url":"https://github.com/patrickpontes44/tiny-panda","last_synced_at":"2026-04-13T20:32:05.909Z","repository":{"id":310914792,"uuid":"1041142924","full_name":"PatrickPontes44/tiny-panda","owner":"PatrickPontes44","description":"tiny-panda is a lightweight JavaScript library inspired by Python’s pandas. It provides a simple, intuitive API for working with tabular data in the browser or Node.js.","archived":false,"fork":false,"pushed_at":"2025-08-28T23:56:32.000Z","size":908,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-29T03:32:54.379Z","etag":null,"topics":["data-science","javascript","javascript-library","machine-learning","pandas","pandas-dataframe","statistics","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PatrickPontes44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-20T03:45:21.000Z","updated_at":"2025-08-28T23:56:35.000Z","dependencies_parsed_at":"2025-08-21T02:28:48.012Z","dependency_job_id":"5328c532-b0bc-44fd-beb4-32b605ddb07f","html_url":"https://github.com/PatrickPontes44/tiny-panda","commit_stats":null,"previous_names":["patrickpontes44/tiny-panda"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PatrickPontes44/tiny-panda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickPontes44%2Ftiny-panda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickPontes44%2Ftiny-panda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickPontes44%2Ftiny-panda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickPontes44%2Ftiny-panda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickPontes44","download_url":"https://codeload.github.com/PatrickPontes44/tiny-panda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickPontes44%2Ftiny-panda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273060931,"owners_count":25038594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","javascript","javascript-library","machine-learning","pandas","pandas-dataframe","statistics","typescript","typescript-library"],"created_at":"2025-09-01T01:01:14.371Z","updated_at":"2026-04-13T20:32:05.872Z","avatar_url":"https://github.com/PatrickPontes44.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"200\" height=\"200\" src=\"./src/assets/tiny_panda.png\"\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e \ntiny-panda is a lightweight JavaScript library inspired by Python’s pandas.\nIt provides a simple, intuitive API for working with tabular data in the browser or Node.js.\n\u003c/div\u003e\n\n---\n\n##  Features\n- Easy-to-use DataFrame and Series objects\n- Data filtering, selection, and transformation\n- Basic statistics and summary methods\n- Import/export to JSON and CSV\n- Familiar pandas-like syntax\n\n---\n\n## Installation\n```\nnpm install tiny-panda\n```\n\n---\n\n## Usage\n#### Series\nA `Series` is a one-dimensional labeled array capable of holding any data type.\n```\n\nimport { Series } from \"tiny-panda\";\n\nconst s = new Series([1, 3, 5, null, 6, 8]);\nconsole.log(s.values);\n// Output: [1, 3, 5, null, 6, 8]\n\n// Get the length\nconsole.log(s.length());\n// Output: 6\n\n// Get unique values\nconsole.log(s.unique().values);\n// Output: [1, 3, 5, null, 6, 8]\n\n// Get value counts\nconst s2 = new Series(['a', 'b', 'a', 'c', 'a', 'd']);\nconsole.log(s2.valueCounts());\n// Output: { a: 3, b: 1, c: 1, d: 1 }\n\nconst numSeries = new Series([10, 20, 30, 40, 50]);\n\nconsole.log(numSeries.sum());   // Output: 150\nconsole.log(numSeries.mean());  // Output: 30\nconsole.log(numSeries.median());// Output: 30\nconsole.log(numSeries.min());   // Output: 10\nconsole.log(numSeries.max());   // Output: 50\n\n// Get a full summary\nconsole.log(numSeries.describe());\n/*\nOutput:\n{\n  max: 50,\n  min: 10,\n  sum: 150,\n  mean: 30,\n  median: 30,\n  mode: 10\n}\n*/\n\nconst s = new Series([1, 2, 3, 4]);\nconst squared = s.apply(x =\u003e x * x);\nconsole.log(squared.values);\n// Output: [1, 4, 9, 16]\n```\n\n#### DataFrame\nA DataFrame is a 2-dimensional labeled data structure with columns of potentially different types.\n```\nimport { DataFrame } from \"tiny-panda\";\n\n// From an array of objects (rows)\nconst df1 = new DataFrame([\n  { name: 'Alice', age: 25, city: 'New York' },\n  { name: 'Bob', age: 30, city: 'Paris' },\n  { name: 'Charlie', age: 35, city: 'London' }\n]);\n\n// From an object of arrays (columns)\nconst df2 = new DataFrame({\n  name: ['Alice', 'Bob', 'Charlie'],\n  age: [25, 30, 35],\n  city: ['New York', 'Paris', 'London']\n});\n\n// Display the first 2 rows\ndf1.head(2).printTable();\n/*\nOutput:\nname    | age | city\n--------|-----|---------\nAlice   | 25  | New York\nBob     | 30  | Paris\n*/\n\n// Get the dimensions of the DataFrame\nconsole.log(df1.shape());\n// Output: [3, 3]\n\n// Select the 'age' column (returns a Series)\nconst ages = (df1 as any).age;\nconsole.log(ages.values);\n// Output: [25, 30, 35]\n\n// Get value by label (row index 1, column 'name')\nconsole.log(df1.loc(1, 'name'));\n// Output: 'Bob'\n\n// Get value by position (row index 2, column index 2)\nconsole.log(df1.iloc(2, 2));\n// Output: 'London'\n\n// Get an entire row by position\nconsole.log(df1.iloc(0));\n// Output: { name: 'Alice', age: 25, city: 'New York' }\n\nconst df = new DataFrame({\n  A: [1, 2, 3],\n  B: [10, 20, 30],\n  C: [100, 200, 300]\n});\n\n// Get the sum of each column\nconsole.log(df.sum());\n// Output: { A: 6, B: 60, C: 600 }\n\n// Get a full statistical summary\nconsole.log(df.describe());\n/*\nOutput:\n{\n  max: { A: 3, B: 30, C: 300 },\n  min: { A: 1, B: 10, C: 100 },\n  sum: { A: 6, B: 60, C: 600 },\n  mean: { A: 2, B: 20, C: 200 },\n  median: { A: 2, B: 20, C: 200 },\n  mode: { A: 1, B: 10, C: 100 }\n}\n*/\n\n// Apply a function to each column (axis=0, default)\nconst columnMax = df.apply(series =\u003e series.max());\nconsole.log(columnMax);\n// Output: { A: 3, B: 30, C: 300 }\n\n// Apply a function to each row (axis=1)\nconst rowSum = df.apply(series =\u003e series.sum(), 1);\nconsole.log(rowSum);\n// Output: [111, 222, 333]\n\n```\n---\n\n## Roadmap\n\n#### Future / Advanced Features\n\nAdd / drop columns (df[\"new\"] = ..., df.drop(\"col\")).\n\nRename columns (df.rename({ old: new })).\n\nSorting (df.sortBy(\"col\")).\n\nFiltering / boolean indexing (df[df[\"a\"].values.map(x =\u003e x \u003e 2)]).\n\nMerge / join / concat multiple DataFrames.\n\nHandling missing values (fillna(), dropna()).\n\nGroupBy / aggregation (df.groupby(\"col\").mean()).\n\n---\n\n## License\n\n**MIT License**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickpontes44%2Ftiny-panda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickpontes44%2Ftiny-panda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickpontes44%2Ftiny-panda/lists"}