{"action":"created","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/15522","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/15522/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/15522/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/15522/events","html_url":"https://github.com/pandas-dev/pandas/issues/15522","id":210596046,"number":15522,"title":"DataFrame.fillna() working on row vector instead of column vector?","user":{"login":"Matsalm","id":11377290,"avatar_url":"https://avatars.githubusercontent.com/u/11377290?v=3","gravatar_id":"","url":"https://api.github.com/users/Matsalm","html_url":"https://github.com/Matsalm","followers_url":"https://api.github.com/users/Matsalm/followers","following_url":"https://api.github.com/users/Matsalm/following{/other_user}","gists_url":"https://api.github.com/users/Matsalm/gists{/gist_id}","starred_url":"https://api.github.com/users/Matsalm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matsalm/subscriptions","organizations_url":"https://api.github.com/users/Matsalm/orgs","repos_url":"https://api.github.com/users/Matsalm/repos","events_url":"https://api.github.com/users/Matsalm/events{/privacy}","received_events_url":"https://api.github.com/users/Matsalm/received_events","type":"User","site_admin":false},"labels":[{"id":2822342,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data","name":"Missing-data","color":"d7e102","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-02-27T20:23:37Z","updated_at":"2017-02-27T20:58:16Z","closed_at":null,"body":"#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\n>>> df.head(5)\r\n                       time   id    bid  bid_depth  bid_depth_total  \\\r\n0 2017-02-27 11:34:31+00:00  105  148.0      497.0         216589.0\r\n1 2017-02-27 11:34:35+00:00  105    NaN        NaN              NaN\r\n2 2017-02-27 11:34:38+00:00  105    NaN        NaN              NaN\r\n3 2017-02-27 11:34:40+00:00  105    NaN        NaN              NaN\r\n4 2017-02-27 11:34:41+00:00  105    NaN        NaN              NaN\r\n\r\n   bid_number  offer  offer_depth  offer_depth_total  offer_number   open  \\\r\n0       243.0  148.1      14192.0           530373.0         503.0  147.5\r\n1         NaN    NaN      14272.0           530453.0         504.0    NaN\r\n2         NaN    NaN      14192.0           530373.0         503.0    NaN\r\n3         NaN    NaN      14272.0           530453.0         504.0    NaN\r\n4         NaN    NaN      14492.0           530673.0         505.0    NaN\r\n\r\n    high    low   last  change  change_percent     volume        value  trades\r\n0  148.2  147.3  148.0     0.9            0.61  1286830.0  190224000.0  2112.0\r\n1    NaN    NaN    NaN     NaN             NaN        NaN          NaN     NaN\r\n2    NaN    NaN    NaN     NaN             NaN        NaN          NaN     NaN\r\n3    NaN    NaN    NaN     NaN             NaN        NaN          NaN     NaN\r\n4    NaN    NaN    NaN     NaN             NaN        NaN          NaN     NaN\r\n\r\n>>> df.fillna(method='pad')\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/usr/lib/python3.6/site-packages/pandas/core/frame.py\", line 2842, in fillna\r\n    downcast=downcast, **kwargs)\r\n  File \"/usr/lib/python3.6/site-packages/pandas/core/generic.py\", line 3250, in fillna\r\n    downcast=downcast)\r\n  File \"/usr/lib/python3.6/site-packages/pandas/core/internals.py\", line 3177, in interpolate\r\n    return self.apply('interpolate', **kwargs)\r\n  File \"/usr/lib/python3.6/site-packages/pandas/core/internals.py\", line 3056, in apply\r\n    applied = getattr(b, f)(**kwargs)\r\n  File \"/usr/lib/python3.6/site-packages/pandas/core/internals.py\", line 917, in interpolate\r\n    downcast=downcast, mgr=mgr)\r\n  File \"/usr/lib/python3.6/site-packages/pandas/core/internals.py\", line 956, in _interpolate_with_fill\r\n    values = self._try_coerce_result(values)\r\n  File \"/usr/lib/python3.6/site-packages/pandas/core/internals.py\", line 2448, in _try_coerce_result\r\n    result = result.reshape(len(result))\r\nValueError: cannot reshape array of size 24311 into shape (1,)\r\n\r\n```\r\n\r\n\r\n#### Problem description\r\nmsgpack of dataframe for replication:\r\nhttps://www.dropbox.com/s/5skf6v8x2vg103o/dataframe?dl=0\r\n\r\nI'm a beginner so I can only guess at what is wrong, but it seems to be working on rows instead of the columns. I can loop through df.columns and do it series by series to end up with the expected output so it doesn't seem to me as if it is a problem with any of the columns.\r\n\r\n#### Expected Output\r\nFill the columns of NaN's with prior value in column.\r\n#### Output of ``pd.show_versions()``\r\n\r\n<details>\r\ncommit: None\r\npython: 3.6.0.final.0\r\npython-bits: 64\r\nOS: Linux\r\nOS-release: 4.9.8-1-ARCH\r\nmachine: x86_64\r\nprocessor:\r\nbyteorder: little\r\nLC_ALL: None\r\nLANG: en_US.UTF-8\r\nLOCALE: en_US.UTF-8\r\n\r\npandas: 0.19.2\r\nnose: None\r\npip: 9.0.1\r\nsetuptools: 34.2.0\r\nCython: None\r\nnumpy: 1.12.0\r\nscipy: None\r\nstatsmodels: None\r\nxarray: None\r\nIPython: None\r\nsphinx: None\r\npatsy: None\r\ndateutil: 2.6.0\r\npytz: 2016.10\r\nblosc: None\r\nbottleneck: None\r\ntables: None\r\nnumexpr: None\r\nmatplotlib: None\r\nopenpyxl: None\r\nxlrd: None\r\nxlwt: None\r\nxlsxwriter: None\r\nlxml: None\r\nbs4: None\r\nhtml5lib: None\r\nhttplib2: None\r\napiclient: None\r\nsqlalchemy: 1.1.5\r\npymysql: None\r\npsycopg2: 2.6.2 (dt dec pq3 ext lo64)\r\njinja2: None\r\nboto: None\r\npandas_datareader: None\r\n</details>\r\n"},"comment":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/comments/282851093","html_url":"https://github.com/pandas-dev/pandas/issues/15522#issuecomment-282851093","issue_url":"https://api.github.com/repos/pandas-dev/pandas/issues/15522","id":282851093,"user":{"login":"Matsalm","id":11377290,"avatar_url":"https://avatars.githubusercontent.com/u/11377290?v=3","gravatar_id":"","url":"https://api.github.com/users/Matsalm","html_url":"https://github.com/Matsalm","followers_url":"https://api.github.com/users/Matsalm/followers","following_url":"https://api.github.com/users/Matsalm/following{/other_user}","gists_url":"https://api.github.com/users/Matsalm/gists{/gist_id}","starred_url":"https://api.github.com/users/Matsalm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matsalm/subscriptions","organizations_url":"https://api.github.com/users/Matsalm/orgs","repos_url":"https://api.github.com/users/Matsalm/repos","events_url":"https://api.github.com/users/Matsalm/events{/privacy}","received_events_url":"https://api.github.com/users/Matsalm/received_events","type":"User","site_admin":false},"created_at":"2017-02-27T20:58:16Z","updated_at":"2017-02-27T20:58:16Z","body":"```python\r\n>>> df.info()\r\n<class 'pandas.core.frame.DataFrame'>\r\nRangeIndex: 24311 entries, 0 to 24310\r\nData columns (total 19 columns):\r\ntime                 24311 non-null datetime64[ns, UTC]\r\nid                   24311 non-null int64\r\nbid                  1469 non-null float64\r\nbid_depth            7988 non-null float64\r\nbid_depth_total      11630 non-null float64\r\nbid_number           10765 non-null float64\r\noffer                1370 non-null float64\r\noffer_depth          7864 non-null float64\r\noffer_depth_total    10617 non-null float64\r\noffer_number         9940 non-null float64\r\nopen                 1085 non-null float64\r\nhigh                 1086 non-null float64\r\nlow                  1085 non-null float64\r\nlast                 1223 non-null float64\r\nchange               1223 non-null float64\r\nchange_percent       1223 non-null float64\r\nvolume               3697 non-null float64\r\nvalue                3697 non-null float64\r\ntrades               3697 non-null float64\r\ndtypes: datetime64[ns, UTC](1), float64(17), int64(1)\r\nmemory usage: 3.5 MB\r\n```"}}
{"actor":{"display_login":"Matsalm"}}