{"id":19044271,"url":"https://github.com/arturogonzalezm/filling_data_python","last_synced_at":"2025-10-07T08:21:02.768Z","repository":{"id":232746660,"uuid":"785086725","full_name":"arturogonzalezm/filling_data_python","owner":"arturogonzalezm","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-11T07:21:03.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T23:18:12.945Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arturogonzalezm.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-11T07:02:50.000Z","updated_at":"2024-04-11T07:21:07.000Z","dependencies_parsed_at":"2024-04-11T08:42:39.397Z","dependency_job_id":null,"html_url":"https://github.com/arturogonzalezm/filling_data_python","commit_stats":null,"previous_names":["arturogonzalezm/filling_data_python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arturogonzalezm/filling_data_python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2Ffilling_data_python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2Ffilling_data_python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2Ffilling_data_python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2Ffilling_data_python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arturogonzalezm","download_url":"https://codeload.github.com/arturogonzalezm/filling_data_python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2Ffilling_data_python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278741214,"owners_count":26037560,"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-10-07T02:00:06.786Z","response_time":59,"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":[],"created_at":"2024-11-08T22:45:21.898Z","updated_at":"2025-10-07T08:21:02.713Z","avatar_url":"https://github.com/arturogonzalezm.png","language":"Python","readme":"# Mercury Level Estimation Tool\n\nThis Python script is designed to estimate missing daily mercury level readings in a river. The data consists of timestamps and mercury levels, with some levels missing and marked accordingly. The script uses linear interpolation to estimate these missing values.\n\n## Instructions:\nA time series of daily readings of mercury levels in a river is provided to you. \nIn each test case, the day's highest level is missing for certain days. \nBy analysing the data, try to identify the missing mercury levels for those days. \nEach row of data contains two tab-separated values: a time-stamp and the day's highest reading.\n\nThere are exactly twenty rows marked missing in each input file. \nThe missing values marked as \"Missing_1\", \"Missing_2\", .....\"Missing_20\". \nThese missing records have been randomly dispersed in the rows of data.\n\nComplete the calcMissing(readings) function in the editor below. \nIt should print 20 rows, one for each missing value, as floats in python.\n\nMercury levels are all \u003c 400. If the missing value is not found, print \"Missing\".\n\n## Functionality\n\nThe core functionality is encapsulated in the `calcMissing(readings)` function. Here's a breakdown of how it works:\n\n### Input Parsing\n\n- The function takes a list of `readings`, where each reading is a string containing a timestamp and a mercury level (or a placeholder for missing values) separated by a tab.\n- It then parses each reading, separating the timestamp from the mercury level.\n- If the mercury level is marked as missing (e.g., \"Missing_1\"), the index of this reading is stored for later processing, and `None` is appended to the `mercury_levels` list to represent the missing value. Otherwise, the mercury level is converted to a float and stored.\n\n### Estimating Missing Values\n\n- For each missing value, the script calculates an estimated value using linear interpolation. This involves:\n  - Finding the nearest non-missing mercury levels before and after the missing value.\n  - Averaging these two values to estimate the missing mercury level.\n- If there's no non-missing value before or after the missing value, the script uses the available non-missing value for the estimation. (In practice, this situation should not occur if the data set starts and ends with non-missing values.)\n\n### Output\n\n- The estimated mercury levels for the missing entries are printed to the console, formatted as floats with two decimal places.\n\n## Running the Script\n\nThe script is intended to be run with Python 3. Ensure you have a data file named `data/input000.txt` in the same directory as the script. This file should contain the readings, starting with the number of readings on the first line followed by each reading on its own line.\n\nTo run the script, simply execute:\n\n```bash\npython3 main.py\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturogonzalezm%2Ffilling_data_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farturogonzalezm%2Ffilling_data_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturogonzalezm%2Ffilling_data_python/lists"}