{"action":"created","issue":{"url":"https://api.github.com/repos/quantopian/alphalens/issues/319","repository_url":"https://api.github.com/repos/quantopian/alphalens","labels_url":"https://api.github.com/repos/quantopian/alphalens/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/quantopian/alphalens/issues/319/comments","events_url":"https://api.github.com/repos/quantopian/alphalens/issues/319/events","html_url":"https://github.com/quantopian/alphalens/issues/319","id":355875734,"node_id":"MDU6SXNzdWUzNTU4NzU3MzQ=","number":319,"title":"Inferred frequency does not conform In Calculating TEARS","user":{"login":"hexiaoling1994","id":18224415,"node_id":"MDQ6VXNlcjE4MjI0NDE1","avatar_url":"https://avatars1.githubusercontent.com/u/18224415?v=4","gravatar_id":"","url":"https://api.github.com/users/hexiaoling1994","html_url":"https://github.com/hexiaoling1994","followers_url":"https://api.github.com/users/hexiaoling1994/followers","following_url":"https://api.github.com/users/hexiaoling1994/following{/other_user}","gists_url":"https://api.github.com/users/hexiaoling1994/gists{/gist_id}","starred_url":"https://api.github.com/users/hexiaoling1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hexiaoling1994/subscriptions","organizations_url":"https://api.github.com/users/hexiaoling1994/orgs","repos_url":"https://api.github.com/users/hexiaoling1994/repos","events_url":"https://api.github.com/users/hexiaoling1994/events{/privacy}","received_events_url":"https://api.github.com/users/hexiaoling1994/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-31T07:49:40Z","updated_at":"2018-08-31T08:18:38Z","closed_at":null,"author_association":"NONE","body":"\r\nHere's the thing, I was dealing with a problem caused by `pandas.datetimeindex.frequency`\r\n\r\nThe api returned clean factor successfully, and I checked the **.freq** attribute, it seems in accordance with my input factor data:\r\n\r\n![default](https://user-images.githubusercontent.com/18224415/44899375-24aca900-ad34-11e8-905f-f8c6efc70b14.PNG)\r\n\r\n\r\nwhen I ran:\r\n\r\n> alphalens.tears.create_returns_tear_sheet(factor_data, long_short=True, group_neutral=True, by_group=False)\r\n\r\nI got the error:\r\n\r\n```\r\nF:\\Anaconda3\\lib\\site-packages\\alphalens-0.3.0-py3.6.egg\\alphalens\\tears.py in create_returns_tear_sheet(factor_data, long_short, group_neutral, by_group)\r\n    316     factor_returns = perf.factor_returns(factor_data,\r\n    317                                          long_short,\r\n--> 318                                          group_neutral)\r\n    319 \r\n    320     mean_quant_ret, std_quantile = \\\r\n\r\nF:\\Anaconda3\\lib\\site-packages\\alphalens-0.3.0-py3.6.egg\\alphalens\\performance.py in factor_returns(factor_data, demeaned, group_adjust, equal_weight, by_asset)\r\n    243 \r\n    244     weights = \\\r\n--> 245         factor_weights(factor_data, demeaned, group_adjust, equal_weight)\r\n    246 \r\n    247     weighted_returns = \\\r\n\r\nF:\\Anaconda3\\lib\\site-packages\\alphalens-0.3.0-py3.6.egg\\alphalens\\performance.py in factor_weights(factor_data, demeaned, group_adjust, equal_weight)\r\n    203 \r\n    204     # preserve freq, which contains trading calendar information\r\n--> 205     weights.index.levels[0].freq = factor_data.index.levels[0].freq\r\n    206     return weights\r\n    207 \r\n\r\nF:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexes\\datetimelike.py in freq(self, value)\r\n    239         if value is not None:\r\n    240             value = frequencies.to_offset(value)\r\n--> 241             self._validate_frequency(self, value)\r\n    242 \r\n    243         self._freq = value\r\n\r\nF:\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexes\\datetimelike.py in _validate_frequency(cls, index, freq, **kwargs)\r\n    228             msg = ('Inferred frequency {infer} from passed values does not '\r\n    229                    'conform to passed frequency {passed}')\r\n--> 230             raise ValueError(msg.format(infer=inferred, passed=freq.freqstr))\r\n    231 \r\n    232     @property\r\n\r\nValueError: Inferred frequency None from passed values does not conform to passed frequency C\r\n```\r\n\r\nSeems the problem was caused by internal attribute **weights**. Any way I can fix this?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/quantopian/alphalens/issues/comments/417590248","html_url":"https://github.com/quantopian/alphalens/issues/319#issuecomment-417590248","issue_url":"https://api.github.com/repos/quantopian/alphalens/issues/319","id":417590248,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzU5MDI0OA==","user":{"login":"luca-s","id":15273575,"node_id":"MDQ6VXNlcjE1MjczNTc1","avatar_url":"https://avatars1.githubusercontent.com/u/15273575?v=4","gravatar_id":"","url":"https://api.github.com/users/luca-s","html_url":"https://github.com/luca-s","followers_url":"https://api.github.com/users/luca-s/followers","following_url":"https://api.github.com/users/luca-s/following{/other_user}","gists_url":"https://api.github.com/users/luca-s/gists{/gist_id}","starred_url":"https://api.github.com/users/luca-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luca-s/subscriptions","organizations_url":"https://api.github.com/users/luca-s/orgs","repos_url":"https://api.github.com/users/luca-s/repos","events_url":"https://api.github.com/users/luca-s/events{/privacy}","received_events_url":"https://api.github.com/users/luca-s/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T08:18:38Z","updated_at":"2018-08-31T08:18:38Z","author_association":"COLLABORATOR","body":"@hexiaoling1994 Could you also make sure you are using the latest Alphalens version 3.2?\r\n\r\n```\r\n>>> import alphalens\r\n>>> alphalens.__version__\r\n'0.3.2'\r\n```"}}
{"actor":{"display_login":"luca-s"}}