{"comment":{"url":"https://api.github.com/repos/dasovm/olga/comments/18532991","html_url":"https://github.com/dasovm/olga/commit/fda2bcfd521c91d01e6f08ad484a55cb8fc8eca3#commitcomment-18532991","id":18532991,"user":{"login":"lindbergan","id":16941585,"avatar_url":"https://avatars.githubusercontent.com/u/16941585?v=3","gravatar_id":"","url":"https://api.github.com/users/lindbergan","html_url":"https://github.com/lindbergan","followers_url":"https://api.github.com/users/lindbergan/followers","following_url":"https://api.github.com/users/lindbergan/following{/other_user}","gists_url":"https://api.github.com/users/lindbergan/gists{/gist_id}","starred_url":"https://api.github.com/users/lindbergan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindbergan/subscriptions","organizations_url":"https://api.github.com/users/lindbergan/orgs","repos_url":"https://api.github.com/users/lindbergan/repos","events_url":"https://api.github.com/users/lindbergan/events{/privacy}","received_events_url":"https://api.github.com/users/lindbergan/received_events","type":"User","site_admin":false},"position":12,"line":8,"path":"modules/export_data.py","commit_id":"fda2bcfd521c91d01e6f08ad484a55cb8fc8eca3","created_at":"2016-08-05T07:06:02Z","updated_at":"2016-08-05T07:06:02Z","body":"Instead of calling the getter 3 times from another module you can declare a local variable and assign the getter to it. This way we minimize processing usage. \r\n\r\n```\r\n    if not os.path.exists(pc.get_stock_data_path()):\r\n        os.makedirs(pc.get_stock_data_path())\r\n    df.to_csv(pc.get_stock_data_path() + ticker + '.csv')\r\n```\r\nLike so:\r\n```\r\n   path = pc.get_stock_data_path()\r\n    if not os.path.exists(path):\r\n        os.makedirs(path)\r\n    df.to_csv(path + ticker + '.csv')\r\n```"}}
{"actor":{"display_login":"lindbergan"}}