{"id":37667612,"url":"https://github.com/albertov5/tec-data-05-matplotlib","last_synced_at":"2026-01-16T12:00:29.885Z","repository":{"id":49817309,"uuid":"518225556","full_name":"AlbertoV5/tec-data-05-matplotlib","owner":"AlbertoV5","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-29T23:04:05.000Z","size":9162,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-04T18:11:46.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/AlbertoV5.png","metadata":{"files":{"readme":"readme.html","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":"2022-07-26T21:44:51.000Z","updated_at":"2022-07-28T19:31:41.000Z","dependencies_parsed_at":"2022-08-25T13:22:55.420Z","dependency_job_id":null,"html_url":"https://github.com/AlbertoV5/tec-data-05-matplotlib","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/AlbertoV5/tec-data-05-matplotlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoV5%2Ftec-data-05-matplotlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoV5%2Ftec-data-05-matplotlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoV5%2Ftec-data-05-matplotlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoV5%2Ftec-data-05-matplotlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlbertoV5","download_url":"https://codeload.github.com/AlbertoV5/tec-data-05-matplotlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoV5%2Ftec-data-05-matplotlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-16T12:00:18.895Z","updated_at":"2026-01-16T12:00:29.856Z","avatar_url":"https://github.com/AlbertoV5.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003c!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\"\u003e\n\u003chead\u003e\n\u003c!-- 2022-07-29 Fri 18:00 --\u003e\n\u003cmeta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /\u003e\n\u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\" /\u003e\n\u003ctitle\u003eChallenge\u003c/title\u003e\n\u003cmeta name=\"author\" content=\"Alberto Valdez\" /\u003e\n\u003cmeta name=\"generator\" content=\"Org Mode\" /\u003e\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"https://albertov5.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css\"/\u003e\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"https://albertov5.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css\"/\u003e\n\u003cscript src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://albertov5.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://albertov5.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cdiv id=\"content\" class=\"content\"\u003e\n\u003ch1 class=\"title\"\u003eChallenge\u003c/h1\u003e\n\u003cdiv id=\"table-of-contents\" role=\"doc-toc\"\u003e\n\u003ch2\u003eTable of Contents\u003c/h2\u003e\n\u003cdiv id=\"text-table-of-contents\" role=\"doc-toc\"\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"#org92e6a69\"\u003ePyBer City Type Analysis\u003c/a\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"#org65c21ab\"\u003eOverview\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#org40f4c3e\"\u003eResults\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#orgeac6879\"\u003eWhere to start? Best Fare Price for Urban cities.\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#orgaae6f4d\"\u003eFrom Urban to Rural or to other cities?\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#orgbf591be\"\u003eWhen is best to move the Drivers?\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#orgeb01f13\"\u003eSummary\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#org9ef0cb2\"\u003eClosing Thoughts\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cdiv id=\"outline-container-org92e6a69\" class=\"outline-2\"\u003e\n\u003ch2 id=\"org92e6a69\"\u003ePyBer City Type Analysis\u003c/h2\u003e\n\u003cdiv class=\"outline-text-2\" id=\"text-org92e6a69\"\u003e\n\u003c/div\u003e\n\u003cdiv id=\"outline-container-org65c21ab\" class=\"outline-3\"\u003e\n\u003ch3 id=\"org65c21ab\"\u003eOverview\u003c/h3\u003e\n\u003cdiv class=\"outline-text-3\" id=\"text-org65c21ab\"\u003e\n\u003cp\u003e\nIn this project, we analyzed the fare, drivers and rides data from PyBer, a ride-sharing app company, and we created many charts to help us visualize the results. Thanks to our analysis, we can draw some conclusions that will help the company make decisions on how to improve its service.\n\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cdiv id=\"outline-container-org40f4c3e\" class=\"outline-3\"\u003e\n\u003ch3 id=\"org40f4c3e\"\u003eResults\u003c/h3\u003e\n\u003cdiv class=\"outline-text-3\" id=\"text-org40f4c3e\"\u003e\n\u003cp\u003e\nOur first impression of the data was that we had a very unbalanced distribution from one city type to another. The amount of drivers in the Urban areas is about thirty times more than in the Rural areas.\n\u003c/p\u003e\n\n\n\u003cdiv id=\"orgbfe55f3\" class=\"figure\"\u003e\n\u003cp\u003e\u003cimg src=\"./analysis/pyberlib/percentage_drivers.png\" alt=\"percentage_drivers.png\" width=\"400px\" /\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cp\u003e\nHere is a summary of the Total results per City Type.\n\u003c/p\u003e\n\n\u003ctable border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\"\u003e\n\n\n\u003ccolgroup\u003e\n\u003ccol  class=\"org-left\" /\u003e\n\n\u003ccol  class=\"org-right\" /\u003e\n\n\u003ccol  class=\"org-right\" /\u003e\n\n\u003ccol  class=\"org-left\" /\u003e\n\n\u003ccol  class=\"org-left\" /\u003e\n\n\u003ccol  class=\"org-left\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth scope=\"col\" class=\"org-left\"\u003eCity Type\u003c/th\u003e\n\u003cth scope=\"col\" class=\"org-right\"\u003eTotal Rides\u003c/th\u003e\n\u003cth scope=\"col\" class=\"org-right\"\u003eTotal Drivers\u003c/th\u003e\n\u003cth scope=\"col\" class=\"org-left\"\u003eTotal Fares\u003c/th\u003e\n\u003cth scope=\"col\" class=\"org-left\"\u003eAverage Fare per Ride\u003c/th\u003e\n\u003cth scope=\"col\" class=\"org-left\"\u003eAverage Fare per Driver\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd class=\"org-left\"\u003eRural\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e125\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e78\u003c/td\u003e\n\u003ctd class=\"org-left\"\u003e$4,327.93\u003c/td\u003e\n\u003ctd class=\"org-left\"\u003e$34.62\u003c/td\u003e\n\u003ctd class=\"org-left\"\u003e$55.49\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd class=\"org-left\"\u003eSuburban\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e625\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e490\u003c/td\u003e\n\u003ctd class=\"org-left\"\u003e$19,356.33\u003c/td\u003e\n\u003ctd class=\"org-left\"\u003e$30.97\u003c/td\u003e\n\u003ctd class=\"org-left\"\u003e$39.50\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd class=\"org-left\"\u003eUrban\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e1,625\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e2,405\u003c/td\u003e\n\u003ctd class=\"org-left\"\u003e$39,854.38\u003c/td\u003e\n\u003ctd class=\"org-left\"\u003e$24.53\u003c/td\u003e\n\u003ctd class=\"org-left\"\u003e$16.57\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003cp\u003e\nThere are a lot of Drivers and Rides in the Urban cities, but compared to the other city types, we seem to have a surplus of Drivers. It becomes more obvious when looking at the \u003ccode\u003eAverage Fare per Driver\u003c/code\u003e, which is very small compared to the other city types.\n\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cdiv id=\"outline-container-orgeac6879\" class=\"outline-3\"\u003e\n\u003ch3 id=\"orgeac6879\"\u003eWhere to start? Best Fare Price for Urban cities.\u003c/h3\u003e\n\u003cdiv class=\"outline-text-3\" id=\"text-orgeac6879\"\u003e\n\u003cp\u003e\nThe Urban results differ a lot from the Rural ones, so in order to find a better amount of Drivers, we will compare them first to the Suburban results.\n\u003c/p\u003e\n\n\u003cp\u003e\nIn the following code, we will look for the number of drivers in Urban cities that will give us the best Total Fare at the same amount of rides.\n\u003c/p\u003e\n\n\u003cdiv class=\"org-src-container\"\u003e\n\u003cpre class=\"src src-python\"\u003e\u003cspan style=\"color: #339CDB;\"\u003eimport\u003c/span\u003e numpy \u003cspan style=\"color: #339CDB;\"\u003eas\u003c/span\u003e np\n\u003cspan style=\"color: #339CDB;\"\u003eimport\u003c/span\u003e matplotlib.pyplot \u003cspan style=\"color: #339CDB;\"\u003eas\u003c/span\u003e plt\n\u003cspan style=\"color: #339CDB;\"\u003efrom\u003c/span\u003e pathlib \u003cspan style=\"color: #339CDB;\"\u003eimport\u003c/span\u003e Path\n\n\n\u003cspan style=\"color: #579C4C;\"\u003e# \u003c/span\u003e\u003cspan style=\"color: #579C4C;\"\u003eCreating lines from Urban to Suburban\u003c/span\u003e\n\u003cspan style=\"color: #d4d4d4;\"\u003edrivers\u003c/span\u003e = np.linspace(\u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e490\u003c/span\u003e, \u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e2405\u003c/span\u003e, \u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e100\u003c/span\u003e)\n\u003cspan style=\"color: #d4d4d4;\"\u003efare_per_ride\u003c/span\u003e = np.linspace(\u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e30.97\u003c/span\u003e, \u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e24.53\u003c/span\u003e, \u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e100\u003c/span\u003e)\n\u003cspan style=\"color: #d4d4d4;\"\u003efare_per_driver\u003c/span\u003e = np.linspace(\u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e39.50\u003c/span\u003e, \u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e16.57\u003c/span\u003e, \u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e100\u003c/span\u003e)\n\u003cspan style=\"color: #579C4C;\"\u003e# \u003c/span\u003e\u003cspan style=\"color: #579C4C;\"\u003eExpecting the amount of Rides to be independent of Drivers\u003c/span\u003e\n\u003cspan style=\"color: #d4d4d4;\"\u003erides\u003c/span\u003e = \u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e1625\u003c/span\u003e\n\u003cspan style=\"color: #d4d4d4;\"\u003erides_per_driver\u003c/span\u003e = rides / drivers\n\n\u003cspan style=\"color: #579C4C;\"\u003e# \u003c/span\u003e\u003cspan style=\"color: #579C4C;\"\u003eFind the index of the max total fare\u003c/span\u003e\n\u003cspan style=\"color: #d4d4d4;\"\u003etotal_fares\u003c/span\u003e = drivers * fare_per_driver\n\u003cspan style=\"color: #d4d4d4;\"\u003em\u003c/span\u003e = np.argmax(total_fares)\n\u003cspan style=\"color: #d4d4d4;\"\u003epoint\u003c/span\u003e = rides_per_driver[m], fare_per_driver[m]\n\u003cspan style=\"color: #d4d4d4;\"\u003edriver_count\u003c/span\u003e = drivers[m]\n\u003cspan style=\"color: #d4d4d4;\"\u003ebest_fare\u003c/span\u003e = total_fares[m]\n\n\u003cspan style=\"color: #579C4C;\"\u003e# \u003c/span\u003e\u003cspan style=\"color: #579C4C;\"\u003ePlotting\u003c/span\u003e\n\u003cspan style=\"color: #d4d4d4;\"\u003efile_path\u003c/span\u003e = Path(\u003cspan style=\"color: #c5937c;\"\u003e\"analysis\"\u003c/span\u003e) / \u003cspan style=\"color: #c5937c;\"\u003e\"the_best_fare_per_driver.png\"\u003c/span\u003e\nplt.plot(rides_per_driver, fare_per_driver, label=\u003cspan style=\"color: #c5937c;\"\u003e\"Urban to Suburban\"\u003c/span\u003e)\nplt.plot(point[\u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e0\u003c/span\u003e], point[\u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e1\u003c/span\u003e], \u003cspan style=\"color: #c5937c;\"\u003e\"ko\"\u003c/span\u003e)\nplt.text(\n    \u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e1\u003c/span\u003e, \u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e20\u003c/span\u003e,\n    f\u003cspan style=\"color: #c5937c;\"\u003e\"Drivers: \u003c/span\u003e{driver_count:,.0f}\u003cspan style=\"color: #c5937c;\"\u003e\\nFare: $\u003c/span\u003e{point[1]:,.2f}\u003cspan style=\"color: #c5937c;\"\u003e\\nTotal Fare: $\u003c/span\u003e{best_fare:,.2f}\u003cspan style=\"color: #c5937c;\"\u003e\"\u003c/span\u003e,\n    fontsize=\u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e12\u003c/span\u003e,\n    bbox = \u003cspan style=\"color: #C586C0;\"\u003edict\u003c/span\u003e(facecolor=\u003cspan style=\"color: #c5937c;\"\u003e\"white\"\u003c/span\u003e, alpha=\u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e0.8\u003c/span\u003e),\n)\nplt.title(f\u003cspan style=\"color: #c5937c;\"\u003e\"Best Fare per Driver for Urban cities\"\u003c/span\u003e, fontsize=\u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e16\u003c/span\u003e)\nplt.ylabel(\u003cspan style=\"color: #c5937c;\"\u003e\"Fare per Driver\"\u003c/span\u003e)\nplt.xlabel(\u003cspan style=\"color: #c5937c;\"\u003e\"Rides per Driver at 1,625 Rides\"\u003c/span\u003e)\nplt.legend()\nplt.savefig(file_path, dpi=\u003cspan style=\"color: #B5CEA8; font-weight: bold;\"\u003e200\u003c/span\u003e)\n\u003cspan style=\"color: #C586C0;\"\u003eprint\u003c/span\u003e(file_path, end=\u003cspan style=\"color: #c5937c;\"\u003e\"\"\u003c/span\u003e)\n\u003c/pre\u003e\n\u003c/div\u003e\n\n\n\u003cdiv id=\"orgef940c7\" class=\"figure\"\u003e\n\u003cp\u003e\u003cimg src=\"analysis/the_best_fare_per_driver.png\" alt=\"the_best_fare_per_driver.png\" width=\"400px\" /\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003e\nWe found that; assuming a linear relationship in the results of Urban and Suburban cities, the number of drivers that would generate the largest Total Fare for Urban cities is \u003ccode\u003e1,902 drivers\u003c/code\u003e. In theory, this follows a supply and demand model, giving us a total of \u003ccode\u003e$42,971.62\u003c/code\u003e Total Fare with that amount of drivers.\n\u003c/p\u003e\n\n\u003cp\u003e\nBecause we are concerned about the effects of reducing the number of drivers, we charted the \u003ccode\u003eRides per Driver\u003c/code\u003e on the x-axis. We can see that the load is not dramatically increased at the \u003ccode\u003eBest Fare\u003c/code\u003e, which means that the result is favorable.\n\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cdiv id=\"outline-container-orgaae6f4d\" class=\"outline-3\"\u003e\n\u003ch3 id=\"orgaae6f4d\"\u003eFrom Urban to Rural or to other cities?\u003c/h3\u003e\n\u003cdiv class=\"outline-text-3\" id=\"text-orgaae6f4d\"\u003e\n\u003cp\u003e\nNow that we know how many drivers we can move out of the Urban cities, we should find which cities have the most drivers and which ones have the most rides. We can better appreciate the distribution of drivers with a Box and Whiskers chart.\n\u003c/p\u003e\n\n\u003cdiv id=\"orgff130d3\" class=\"figure\"\u003e\n\u003cp\u003e\u003cimg src=\"./analysis/pyberlib/citytype_rides.png\" alt=\"citytype_rides.png\" width=\"500px\" /\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cp\u003e\nMaybe we can start thinking about separating cities by the number of rides because the difference in rides in Urban cities is three times the difference in Rural and almost two times the difference in Suburban cities. This would help us find the surplus of drivers in specific groups of cities rather than broad categories.\n\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cdiv id=\"outline-container-orgbf591be\" class=\"outline-3\"\u003e\n\u003ch3 id=\"orgbf591be\"\u003eWhen is best to move the Drivers?\u003c/h3\u003e\n\u003cdiv class=\"outline-text-3\" id=\"text-orgbf591be\"\u003e\n\u003cp\u003e\nFinally, we can generate a time series chart to visualize the Total Fare by city type to try to find at which point in time is best to move drivers from one city type to another. This will help us minimize a reduction in Total Fare caused by the logistics of changing our current distribution of drivers.\n\u003c/p\u003e\n\n\u003ctable border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\"\u003e\n\n\n\u003ccolgroup\u003e\n\u003ccol  class=\"org-right\" /\u003e\n\n\u003ccol  class=\"org-right\" /\u003e\n\n\u003ccol  class=\"org-right\" /\u003e\n\n\u003ccol  class=\"org-right\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth scope=\"col\" class=\"org-right\"\u003edate\u003c/th\u003e\n\u003cth scope=\"col\" class=\"org-right\"\u003eRural\u003c/th\u003e\n\u003cth scope=\"col\" class=\"org-right\"\u003eSuburban\u003c/th\u003e\n\u003cth scope=\"col\" class=\"org-right\"\u003eUrban\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd class=\"org-right\"\u003e2019-01-06\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e187.92\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e721.60\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e1661.68\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd class=\"org-right\"\u003e2019-01-13\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e67.65\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e1105.13\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e2050.43\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd class=\"org-right\"\u003e2019-01-20\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e306.00\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e1218.20\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e1939.02\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd class=\"org-right\"\u003e2019-01-27\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e179.69\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e1203.28\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e2129.51\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd class=\"org-right\"\u003e2019-02-03\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e333.08\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e1042.79\u003c/td\u003e\n\u003ctd class=\"org-right\"\u003e2086.94\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\u003cdiv id=\"org9a35340\" class=\"figure\"\u003e\n\u003cp\u003e\u003cimg src=\"./analysis/pyberlib/PyBer_fare_summary.png\" alt=\"PyBer_fare_summary.png\" width=\"700px\" /\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cdiv id=\"outline-container-orgeb01f13\" class=\"outline-3\"\u003e\n\u003ch3 id=\"orgeb01f13\"\u003eSummary\u003c/h3\u003e\n\u003cdiv class=\"outline-text-3\" id=\"text-orgeb01f13\"\u003e\n\u003cp\u003e\nWe can improve fares and optimize the number of drivers across all cities by making the following changes:\n\u003c/p\u003e\n\n\u003col class=\"org-ol\"\u003e\n\u003cli\u003eImprove the distribution of drivers in the Urban cities by moving from cities with low rides and a high number of drivers to cities with high rides and the low number of drivers.\u003c/li\u003e\n\u003cli\u003eMove about \u003ccode\u003e500 drivers\u003c/code\u003e out of the Urban cities into Suburban cities as the distributions are closer. Then move from Suburban cities to Rural areas. Before starting the transition, make sure that the Suburban and Rural areas won\u0026rsquo;t be heavily affected by the surplus of drivers. If they would, then either move fewer drivers knowing that the Total Fare won\u0026rsquo;t be optimal; or, as a last resort, consider letting go of a few drivers.\u003c/li\u003e\n\u003cli\u003eExecute the transition from Urban to Suburban at the start of February and from Suburban to Rural at the start of March as those seem to be the dates with less activity and less Total Fare for each category.\u003c/li\u003e\n\u003c/ol\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cdiv id=\"outline-container-org9ef0cb2\" class=\"outline-3\"\u003e\n\u003ch3 id=\"org9ef0cb2\"\u003eClosing Thoughts\u003c/h3\u003e\n\u003cdiv class=\"outline-text-3\" id=\"text-org9ef0cb2\"\u003e\n\u003cp\u003e\nData transformation and visualization are critical tools to help us make decisions by having a better appreciation of the data. Python makes it easy for us to generate charts programatically, so much so that we can save our favorite chart configurations in a package for later use.\n\u003c/p\u003e\n\n\u003cdiv class=\"org-src-container\"\u003e\n\u003cpre class=\"src src-python\"\u003e\u003cspan style=\"color: #339CDB;\"\u003efrom\u003c/span\u003e pyberlib \u003cspan style=\"color: #339CDB;\"\u003eimport\u003c/span\u003e Pyber\n\n\u003cspan style=\"color: #d4d4d4;\"\u003emy_methods\u003c/span\u003e = [m \u003cspan style=\"color: #339CDB;\"\u003efor\u003c/span\u003e m \u003cspan style=\"color: #339CDB;\"\u003ein\u003c/span\u003e \u003cspan style=\"color: #C586C0;\"\u003edir\u003c/span\u003e(Pyber) \u003cspan style=\"color: #339CDB;\"\u003eif\u003c/span\u003e \u003cspan style=\"color: #c5937c;\"\u003e\"__\"\u003c/span\u003e \u003cspan style=\"color: #339CDB;\"\u003enot\u003c/span\u003e \u003cspan style=\"color: #339CDB;\"\u003ein\u003c/span\u003e m]\n\u003c/pre\u003e\n\u003c/div\u003e\n\n\u003cdiv class=\"org-src-container\"\u003e\n\u003cpre class=\"src src-org\"\u003e['_get_squared_figure', '_get_ultra_wide_figure', '_get_wide_figure', '_plot_bubble', 'bubble_text_args', 'city_types', 'colormap', 'colormap_reversed', 'colors', 'dpi', 'fontsize', 'plot_box_and_whiskers', 'plot_bubble_combined', 'plot_bubble_many', 'plot_pie_chart', 'plot_timeseries', 'savefig']\n\u003c/pre\u003e\n\u003c/div\u003e\n\n\n\u003cdiv id=\"orgc32e8cb\" class=\"figure\"\u003e\n\u003cp\u003e\u003cimg src=\"./analysis/ridesharing.png\" alt=\"ridesharing.png\" width=\"600px\" /\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"postamble\" class=\"status\"\u003e\n\u003cp class=\"author\"\u003eAuthor: Alberto Valdez\u003c/p\u003e\n\u003cp class=\"date\"\u003eCreated: 2022-07-29 Fri 18:00\u003c/p\u003e\n\u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertov5%2Ftec-data-05-matplotlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbertov5%2Ftec-data-05-matplotlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertov5%2Ftec-data-05-matplotlib/lists"}