{"action":"created","issue":{"url":"https://api.github.com/repos/nilmtk/nilmtk/issues/436","labels_url":"https://api.github.com/repos/nilmtk/nilmtk/issues/436/labels{/name}","comments_url":"https://api.github.com/repos/nilmtk/nilmtk/issues/436/comments","events_url":"https://api.github.com/repos/nilmtk/nilmtk/issues/436/events","html_url":"https://github.com/nilmtk/nilmtk/issues/436","id":108324072,"number":436,"title":"How to subtract two data frames? How to calculate power reactive based in power apparent and power active?","user":{"login":"haderazzini","id":13726816,"avatar_url":"https://avatars.githubusercontent.com/u/13726816?v=3","gravatar_id":"","url":"https://api.github.com/users/haderazzini","html_url":"https://github.com/haderazzini","followers_url":"https://api.github.com/users/haderazzini/followers","following_url":"https://api.github.com/users/haderazzini/following{/other_user}","gists_url":"https://api.github.com/users/haderazzini/gists{/gist_id}","starred_url":"https://api.github.com/users/haderazzini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haderazzini/subscriptions","organizations_url":"https://api.github.com/users/haderazzini/orgs","repos_url":"https://api.github.com/users/haderazzini/repos","events_url":"https://api.github.com/users/haderazzini/events{/privacy}","received_events_url":"https://api.github.com/users/haderazzini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-25T13:15:16Z","updated_at":"2015-09-25T15:54:29Z","closed_at":null,"body":"I am using the UKDALE dataset and the main meter of the building number 1 has only power apparent and power active. I would like to calculate the reactive power, so, I wrote this code:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/13726816/10101229/c2af112c-6397-11e5-8920-9f79a99d9eb1.png)\r\n![image](https://cloud.githubusercontent.com/assets/13726816/10101238/d6435de2-6397-11e5-9546-6834c17a06e2.png)\r\n\r\nBut it doesn't work. Does someone know how I can calculate this?"},"comment":{"url":"https://api.github.com/repos/nilmtk/nilmtk/issues/comments/143259847","html_url":"https://github.com/nilmtk/nilmtk/issues/436#issuecomment-143259847","issue_url":"https://api.github.com/repos/nilmtk/nilmtk/issues/436","id":143259847,"user":{"login":"JackKelly","id":460756,"avatar_url":"https://avatars.githubusercontent.com/u/460756?v=3","gravatar_id":"","url":"https://api.github.com/users/JackKelly","html_url":"https://github.com/JackKelly","followers_url":"https://api.github.com/users/JackKelly/followers","following_url":"https://api.github.com/users/JackKelly/following{/other_user}","gists_url":"https://api.github.com/users/JackKelly/gists{/gist_id}","starred_url":"https://api.github.com/users/JackKelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackKelly/subscriptions","organizations_url":"https://api.github.com/users/JackKelly/orgs","repos_url":"https://api.github.com/users/JackKelly/repos","events_url":"https://api.github.com/users/JackKelly/events{/privacy}","received_events_url":"https://api.github.com/users/JackKelly/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T15:54:29Z","updated_at":"2015-09-25T15:54:29Z","body":"This is a Pandas question, really.  If you haven't done so already, I'd suggest reading the excellent [Pandas docs](http://pandas.pydata.org/pandas-docs/version/0.16.2/).\r\n\r\nBut, for now, to achieve what you describe... if you follow on from my comment above, just add the line:\r\n\r\n```python\r\nmains_data['power', 'reactive'] = np.sqrt(mains_data['power', 'apparent'].pow(2) - mains_data['power', 'active'].pow(2))\r\n```"}}