{"id":21287845,"url":"https://github.com/daikikatsuragawa/df4loop","last_synced_at":"2026-05-19T11:06:53.163Z","repository":{"id":51386959,"uuid":"366729997","full_name":"daikikatsuragawa/df4loop","owner":"daikikatsuragawa","description":"df4loop supports general purpose processes that requires a combination of both pandas.DataFrame and loop. Specifically, the mission of df4loop is to \"speed up processing\" and \"make complex code intuitive\" at low installation costs.","archived":false,"fork":false,"pushed_at":"2021-06-15T11:53:58.000Z","size":16,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T19:39:01.702Z","etag":null,"topics":["high-performance","library","pandas","pypi-package","python","useful"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/df4loop/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daikikatsuragawa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-12T13:44:08.000Z","updated_at":"2021-06-15T11:56:15.000Z","dependencies_parsed_at":"2022-09-11T20:10:58.331Z","dependency_job_id":null,"html_url":"https://github.com/daikikatsuragawa/df4loop","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daikikatsuragawa%2Fdf4loop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daikikatsuragawa%2Fdf4loop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daikikatsuragawa%2Fdf4loop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daikikatsuragawa%2Fdf4loop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daikikatsuragawa","download_url":"https://codeload.github.com/daikikatsuragawa/df4loop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243748191,"owners_count":20341644,"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","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":["high-performance","library","pandas","pypi-package","python","useful"],"created_at":"2024-11-21T12:16:25.488Z","updated_at":"2026-05-19T11:06:48.121Z","avatar_url":"https://github.com/daikikatsuragawa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# df4loop\n\ndf4loop supports general purpose processes that requires a combination of both pandas.DataFrame and loop. Specifically, the mission of df4loop is to \"speed up processing\" and \"make complex code intuitive\" at low installation costs.\n\n## Installation\n\n```sh\npip install df4loop\n```\n\n## Usage\n\nThe following DataFrame is defined to assist users envision the use of df4loop.\n\n```py\nimport pandas as pd\n\nsample_dict = {\n    \"column_1\": [100, 200, 300, 400, 500],\n    \"column_2\": [\"A\", \"B\", \"C\", \"D\", \"E\"],\n    \"column_3\": [\"a\", \"b\", \"c\", \"d\", \"e\"],\n}\ndf = pd.DataFrame.from_dict(sample_dict)\ndf\n```\n\n|     |column_1|column_2|column_3|\n|----:|-------:|--------|--------|\n|    0|     100|A       |a       |\n|    1|     200|B       |b       |\n|    2|     300|C       |c       |\n|    3|     400|D       |d       |\n|    4|     500|E       |e       |\n\n### DFIterator\n\nDFIterator helps developers writing the following code. This is code written using pandas.DataFrame.iterrows for the purpose of referencing a value by row.\n\n```py\nfor index, row in df.iterrows():\n    tmp = row[\"column_1\"]\n```\n\nDFIterator reproduces this process and speeds it up. Actually, DataFrame and its row pandas.Series are converted to lists and dictionaries to speed up. However, the usage is almost the same.\n\n```py\nfrom df4loop import DFIterator\n\ndf_iterator = DFIterator(df)\nfor index, row in df_iterator.iterrows():\n    tmp = row[\"column_1\"]\n```\n\nIf you do not need to output the index, set `return_indexes=False`.\n\n```py\nfrom df4loop import DFIterator\n\ndf_iterator = DFIterator(df)\nfor row in df_iterator.iterrows(return_indexes=False):\n    tmp = row[\"column_1\"]\n```\n\n### DFGenerator\n\nDFGenerator supports the generation of DataFrame with rows set by loops. Adding rows to the DataFrame in a loop will take a long time to process. The secret to speeding up is to organize rows in a list or dictionary and then make them pandas.DataFrame at once. DFGenerator supports this process for intuitive implementation.\n\nThe following code is an example of selecting the dict type as the row.\n\n```py\nfrom df4loop import DFGenerator\n\n# It is not necessary to specify columns.\ndf_generator = DFGenerator(columns=df.columns.values.tolist())\nfor _, row in df.iterrows():\n    tmp_row = {\n        \"column_1\": row[\"column_1\"],\n        \"column_2\": row[\"column_2\"],\n        \"column_3\": row[\"column_3\"],\n    }\n    df_generator.append(tmp_row)\nnew_df = df_generator.generate_df()\n```\n\nThe following code is an example of selecting the list type as the row. columns must be specified during initialization.\n\n```py\nfrom df4loop import DFGenerator\n\ndf_generator = DFGenerator(columns=df.columns.values.tolist())\nfor _, row in df.iterrows():\n    tmp_row = [\n        row[\"column_1\"],\n        row[\"column_2\"],\n        row[\"column_3\"],\n    ]\n    df_generator.append(tmp_row)\nnew_df = df_generator.generate_df()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaikikatsuragawa%2Fdf4loop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaikikatsuragawa%2Fdf4loop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaikikatsuragawa%2Fdf4loop/lists"}