{"action":"created","comment":{"url":"https://api.github.com/repos/quantopian/pyfolio/pulls/comments/89111483","pull_request_review_id":9659819,"id":89111483,"diff_hunk":"@@ -354,7 +354,7 @@ def plot_holdings(returns, positions, legend_loc='best', ax=None, **kwargs):\n         ax = plt.gca()\n \n     positions = positions.copy().drop('cash', axis='columns')\n-    df_holdings = positions.apply(lambda x: np.sum(x != 0), axis='columns')\n+    df_holdings = positions.replace(0, np.nan).count(axis=1)","path":"pyfolio/plotting.py","position":5,"original_position":5,"commit_id":"3256a5ab37196c3397f3cedd9a4c8d05b8164433","original_commit_id":"3256a5ab37196c3397f3cedd9a4c8d05b8164433","user":{"login":"twiecki","id":674200,"avatar_url":"https://avatars.githubusercontent.com/u/674200?v=3","gravatar_id":"","url":"https://api.github.com/users/twiecki","html_url":"https://github.com/twiecki","followers_url":"https://api.github.com/users/twiecki/followers","following_url":"https://api.github.com/users/twiecki/following{/other_user}","gists_url":"https://api.github.com/users/twiecki/gists{/gist_id}","starred_url":"https://api.github.com/users/twiecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twiecki/subscriptions","organizations_url":"https://api.github.com/users/twiecki/orgs","repos_url":"https://api.github.com/users/twiecki/repos","events_url":"https://api.github.com/users/twiecki/events{/privacy}","received_events_url":"https://api.github.com/users/twiecki/received_events","type":"User","site_admin":false},"body":"`.fillna(0)`","created_at":"2016-11-22T13:10:06Z","updated_at":"2016-11-22T13:10:06Z","html_url":"https://github.com/quantopian/pyfolio/pull/351#discussion_r89111483","pull_request_url":"https://api.github.com/repos/quantopian/pyfolio/pulls/351","_links":{"self":{"href":"https://api.github.com/repos/quantopian/pyfolio/pulls/comments/89111483"},"html":{"href":"https://github.com/quantopian/pyfolio/pull/351#discussion_r89111483"},"pull_request":{"href":"https://api.github.com/repos/quantopian/pyfolio/pulls/351"}}},"pull_request":{"url":"https://api.github.com/repos/quantopian/pyfolio/pulls/351","id":94251248,"html_url":"https://github.com/quantopian/pyfolio/pull/351","diff_url":"https://github.com/quantopian/pyfolio/pull/351.diff","patch_url":"https://github.com/quantopian/pyfolio/pull/351.patch","issue_url":"https://api.github.com/repos/quantopian/pyfolio/issues/351","number":351,"state":"open","locked":false,"title":"Detect intraday strategies and remove gross_lev","user":{"login":"gusgordon","id":1934957,"avatar_url":"https://avatars.githubusercontent.com/u/1934957?v=3","gravatar_id":"","url":"https://api.github.com/users/gusgordon","html_url":"https://github.com/gusgordon","followers_url":"https://api.github.com/users/gusgordon/followers","following_url":"https://api.github.com/users/gusgordon/following{/other_user}","gists_url":"https://api.github.com/users/gusgordon/gists{/gist_id}","starred_url":"https://api.github.com/users/gusgordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gusgordon/subscriptions","organizations_url":"https://api.github.com/users/gusgordon/orgs","repos_url":"https://api.github.com/users/gusgordon/repos","events_url":"https://api.github.com/users/gusgordon/events{/privacy}","received_events_url":"https://api.github.com/users/gusgordon/received_events","type":"User","site_admin":false},"body":"Detect intraday strategies using the new `utils.detect_intraday` function, and resample the positions for intraday algorithms using the new `utils.estimate_intraday` function. This is applied automatically in tear sheets, but the user can override the detection. If users want to run a single plotting function with intraday-corrected returns, they can call `utils.estimate_intraday`, then pass the corrected positions to the plotting function.\r\n\r\nAdditionally, remove `gross_lev` as an argument. When needed, gross leverage will be calculated with `timeseries.gross_lev`, which is passed `positions` instead.","created_at":"2016-11-17T21:10:55Z","updated_at":"2016-11-22T13:10:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6bcb703f972b532d8403214864132e632eabee6a","assignee":{"login":"twiecki","id":674200,"avatar_url":"https://avatars.githubusercontent.com/u/674200?v=3","gravatar_id":"","url":"https://api.github.com/users/twiecki","html_url":"https://github.com/twiecki","followers_url":"https://api.github.com/users/twiecki/followers","following_url":"https://api.github.com/users/twiecki/following{/other_user}","gists_url":"https://api.github.com/users/twiecki/gists{/gist_id}","starred_url":"https://api.github.com/users/twiecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twiecki/subscriptions","organizations_url":"https://api.github.com/users/twiecki/orgs","repos_url":"https://api.github.com/users/twiecki/repos","events_url":"https://api.github.com/users/twiecki/events{/privacy}","received_events_url":"https://api.github.com/users/twiecki/received_events","type":"User","site_admin":false},"assignees":[{"login":"twiecki","id":674200,"avatar_url":"https://avatars.githubusercontent.com/u/674200?v=3","gravatar_id":"","url":"https://api.github.com/users/twiecki","html_url":"https://github.com/twiecki","followers_url":"https://api.github.com/users/twiecki/followers","following_url":"https://api.github.com/users/twiecki/following{/other_user}","gists_url":"https://api.github.com/users/twiecki/gists{/gist_id}","starred_url":"https://api.github.com/users/twiecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twiecki/subscriptions","organizations_url":"https://api.github.com/users/twiecki/orgs","repos_url":"https://api.github.com/users/twiecki/repos","events_url":"https://api.github.com/users/twiecki/events{/privacy}","received_events_url":"https://api.github.com/users/twiecki/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/quantopian/pyfolio/pulls/351/commits","review_comments_url":"https://api.github.com/repos/quantopian/pyfolio/pulls/351/comments","review_comment_url":"https://api.github.com/repos/quantopian/pyfolio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quantopian/pyfolio/issues/351/comments","statuses_url":"https://api.github.com/repos/quantopian/pyfolio/statuses/3256a5ab37196c3397f3cedd9a4c8d05b8164433","head":{"label":"quantopian:intraday-and-gross-lev","ref":"intraday-and-gross-lev","sha":"3256a5ab37196c3397f3cedd9a4c8d05b8164433","user":{"login":"quantopian","id":1393215,"avatar_url":"https://avatars.githubusercontent.com/u/1393215?v=3","gravatar_id":"","url":"https://api.github.com/users/quantopian","html_url":"https://github.com/quantopian","followers_url":"https://api.github.com/users/quantopian/followers","following_url":"https://api.github.com/users/quantopian/following{/other_user}","gists_url":"https://api.github.com/users/quantopian/gists{/gist_id}","starred_url":"https://api.github.com/users/quantopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantopian/subscriptions","organizations_url":"https://api.github.com/users/quantopian/orgs","repos_url":"https://api.github.com/users/quantopian/repos","events_url":"https://api.github.com/users/quantopian/events{/privacy}","received_events_url":"https://api.github.com/users/quantopian/received_events","type":"Organization","site_admin":false},"repo":{"id":36670205,"name":"pyfolio","full_name":"quantopian/pyfolio","owner":{"login":"quantopian","id":1393215,"avatar_url":"https://avatars.githubusercontent.com/u/1393215?v=3","gravatar_id":"","url":"https://api.github.com/users/quantopian","html_url":"https://github.com/quantopian","followers_url":"https://api.github.com/users/quantopian/followers","following_url":"https://api.github.com/users/quantopian/following{/other_user}","gists_url":"https://api.github.com/users/quantopian/gists{/gist_id}","starred_url":"https://api.github.com/users/quantopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantopian/subscriptions","organizations_url":"https://api.github.com/users/quantopian/orgs","repos_url":"https://api.github.com/users/quantopian/repos","events_url":"https://api.github.com/users/quantopian/events{/privacy}","received_events_url":"https://api.github.com/users/quantopian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quantopian/pyfolio","description":"Portfolio and risk analytics in Python","fork":false,"url":"https://api.github.com/repos/quantopian/pyfolio","forks_url":"https://api.github.com/repos/quantopian/pyfolio/forks","keys_url":"https://api.github.com/repos/quantopian/pyfolio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quantopian/pyfolio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quantopian/pyfolio/teams","hooks_url":"https://api.github.com/repos/quantopian/pyfolio/hooks","issue_events_url":"https://api.github.com/repos/quantopian/pyfolio/issues/events{/number}","events_url":"https://api.github.com/repos/quantopian/pyfolio/events","assignees_url":"https://api.github.com/repos/quantopian/pyfolio/assignees{/user}","branches_url":"https://api.github.com/repos/quantopian/pyfolio/branches{/branch}","tags_url":"https://api.github.com/repos/quantopian/pyfolio/tags","blobs_url":"https://api.github.com/repos/quantopian/pyfolio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quantopian/pyfolio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quantopian/pyfolio/git/refs{/sha}","trees_url":"https://api.github.com/repos/quantopian/pyfolio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quantopian/pyfolio/statuses/{sha}","languages_url":"https://api.github.com/repos/quantopian/pyfolio/languages","stargazers_url":"https://api.github.com/repos/quantopian/pyfolio/stargazers","contributors_url":"https://api.github.com/repos/quantopian/pyfolio/contributors","subscribers_url":"https://api.github.com/repos/quantopian/pyfolio/subscribers","subscription_url":"https://api.github.com/repos/quantopian/pyfolio/subscription","commits_url":"https://api.github.com/repos/quantopian/pyfolio/commits{/sha}","git_commits_url":"https://api.github.com/repos/quantopian/pyfolio/git/commits{/sha}","comments_url":"https://api.github.com/repos/quantopian/pyfolio/comments{/number}","issue_comment_url":"https://api.github.com/repos/quantopian/pyfolio/issues/comments{/number}","contents_url":"https://api.github.com/repos/quantopian/pyfolio/contents/{+path}","compare_url":"https://api.github.com/repos/quantopian/pyfolio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quantopian/pyfolio/merges","archive_url":"https://api.github.com/repos/quantopian/pyfolio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quantopian/pyfolio/downloads","issues_url":"https://api.github.com/repos/quantopian/pyfolio/issues{/number}","pulls_url":"https://api.github.com/repos/quantopian/pyfolio/pulls{/number}","milestones_url":"https://api.github.com/repos/quantopian/pyfolio/milestones{/number}","notifications_url":"https://api.github.com/repos/quantopian/pyfolio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quantopian/pyfolio/labels{/name}","releases_url":"https://api.github.com/repos/quantopian/pyfolio/releases{/id}","deployments_url":"https://api.github.com/repos/quantopian/pyfolio/deployments","created_at":"2015-06-01T15:31:39Z","updated_at":"2016-11-22T12:38:59Z","pushed_at":"2016-11-21T22:39:50Z","git_url":"git://github.com/quantopian/pyfolio.git","ssh_url":"git@github.com:quantopian/pyfolio.git","clone_url":"https://github.com/quantopian/pyfolio.git","svn_url":"https://github.com/quantopian/pyfolio","homepage":"http://quantopian.github.io/pyfolio","size":75688,"stargazers_count":817,"watchers_count":817,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":217,"mirror_url":null,"open_issues_count":51,"forks":217,"open_issues":51,"watchers":817,"default_branch":"master"}},"base":{"label":"quantopian:master","ref":"master","sha":"5d63df4ca6e0ead83f4bebf9860732d37f532026","user":{"login":"quantopian","id":1393215,"avatar_url":"https://avatars.githubusercontent.com/u/1393215?v=3","gravatar_id":"","url":"https://api.github.com/users/quantopian","html_url":"https://github.com/quantopian","followers_url":"https://api.github.com/users/quantopian/followers","following_url":"https://api.github.com/users/quantopian/following{/other_user}","gists_url":"https://api.github.com/users/quantopian/gists{/gist_id}","starred_url":"https://api.github.com/users/quantopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantopian/subscriptions","organizations_url":"https://api.github.com/users/quantopian/orgs","repos_url":"https://api.github.com/users/quantopian/repos","events_url":"https://api.github.com/users/quantopian/events{/privacy}","received_events_url":"https://api.github.com/users/quantopian/received_events","type":"Organization","site_admin":false},"repo":{"id":36670205,"name":"pyfolio","full_name":"quantopian/pyfolio","owner":{"login":"quantopian","id":1393215,"avatar_url":"https://avatars.githubusercontent.com/u/1393215?v=3","gravatar_id":"","url":"https://api.github.com/users/quantopian","html_url":"https://github.com/quantopian","followers_url":"https://api.github.com/users/quantopian/followers","following_url":"https://api.github.com/users/quantopian/following{/other_user}","gists_url":"https://api.github.com/users/quantopian/gists{/gist_id}","starred_url":"https://api.github.com/users/quantopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantopian/subscriptions","organizations_url":"https://api.github.com/users/quantopian/orgs","repos_url":"https://api.github.com/users/quantopian/repos","events_url":"https://api.github.com/users/quantopian/events{/privacy}","received_events_url":"https://api.github.com/users/quantopian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quantopian/pyfolio","description":"Portfolio and risk analytics in Python","fork":false,"url":"https://api.github.com/repos/quantopian/pyfolio","forks_url":"https://api.github.com/repos/quantopian/pyfolio/forks","keys_url":"https://api.github.com/repos/quantopian/pyfolio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quantopian/pyfolio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quantopian/pyfolio/teams","hooks_url":"https://api.github.com/repos/quantopian/pyfolio/hooks","issue_events_url":"https://api.github.com/repos/quantopian/pyfolio/issues/events{/number}","events_url":"https://api.github.com/repos/quantopian/pyfolio/events","assignees_url":"https://api.github.com/repos/quantopian/pyfolio/assignees{/user}","branches_url":"https://api.github.com/repos/quantopian/pyfolio/branches{/branch}","tags_url":"https://api.github.com/repos/quantopian/pyfolio/tags","blobs_url":"https://api.github.com/repos/quantopian/pyfolio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quantopian/pyfolio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quantopian/pyfolio/git/refs{/sha}","trees_url":"https://api.github.com/repos/quantopian/pyfolio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quantopian/pyfolio/statuses/{sha}","languages_url":"https://api.github.com/repos/quantopian/pyfolio/languages","stargazers_url":"https://api.github.com/repos/quantopian/pyfolio/stargazers","contributors_url":"https://api.github.com/repos/quantopian/pyfolio/contributors","subscribers_url":"https://api.github.com/repos/quantopian/pyfolio/subscribers","subscription_url":"https://api.github.com/repos/quantopian/pyfolio/subscription","commits_url":"https://api.github.com/repos/quantopian/pyfolio/commits{/sha}","git_commits_url":"https://api.github.com/repos/quantopian/pyfolio/git/commits{/sha}","comments_url":"https://api.github.com/repos/quantopian/pyfolio/comments{/number}","issue_comment_url":"https://api.github.com/repos/quantopian/pyfolio/issues/comments{/number}","contents_url":"https://api.github.com/repos/quantopian/pyfolio/contents/{+path}","compare_url":"https://api.github.com/repos/quantopian/pyfolio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quantopian/pyfolio/merges","archive_url":"https://api.github.com/repos/quantopian/pyfolio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quantopian/pyfolio/downloads","issues_url":"https://api.github.com/repos/quantopian/pyfolio/issues{/number}","pulls_url":"https://api.github.com/repos/quantopian/pyfolio/pulls{/number}","milestones_url":"https://api.github.com/repos/quantopian/pyfolio/milestones{/number}","notifications_url":"https://api.github.com/repos/quantopian/pyfolio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quantopian/pyfolio/labels{/name}","releases_url":"https://api.github.com/repos/quantopian/pyfolio/releases{/id}","deployments_url":"https://api.github.com/repos/quantopian/pyfolio/deployments","created_at":"2015-06-01T15:31:39Z","updated_at":"2016-11-22T12:38:59Z","pushed_at":"2016-11-21T22:39:50Z","git_url":"git://github.com/quantopian/pyfolio.git","ssh_url":"git@github.com:quantopian/pyfolio.git","clone_url":"https://github.com/quantopian/pyfolio.git","svn_url":"https://github.com/quantopian/pyfolio","homepage":"http://quantopian.github.io/pyfolio","size":75688,"stargazers_count":817,"watchers_count":817,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":217,"mirror_url":null,"open_issues_count":51,"forks":217,"open_issues":51,"watchers":817,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quantopian/pyfolio/pulls/351"},"html":{"href":"https://github.com/quantopian/pyfolio/pull/351"},"issue":{"href":"https://api.github.com/repos/quantopian/pyfolio/issues/351"},"comments":{"href":"https://api.github.com/repos/quantopian/pyfolio/issues/351/comments"},"review_comments":{"href":"https://api.github.com/repos/quantopian/pyfolio/pulls/351/comments"},"review_comment":{"href":"https://api.github.com/repos/quantopian/pyfolio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quantopian/pyfolio/pulls/351/commits"},"statuses":{"href":"https://api.github.com/repos/quantopian/pyfolio/statuses/3256a5ab37196c3397f3cedd9a4c8d05b8164433"}}}}
{"actor":{"display_login":"twiecki"}}