{"action":"created","issue":{"url":"https://api.github.com/repos/blaze/dask/issues/897","labels_url":"https://api.github.com/repos/blaze/dask/issues/897/labels{/name}","comments_url":"https://api.github.com/repos/blaze/dask/issues/897/comments","events_url":"https://api.github.com/repos/blaze/dask/issues/897/events","html_url":"https://github.com/blaze/dask/issues/897","id":124290798,"number":897,"title":"Dimension inconsistent? ","user":{"login":"terrytangyuan","id":4269898,"avatar_url":"https://avatars.githubusercontent.com/u/4269898?v=3","gravatar_id":"","url":"https://api.github.com/users/terrytangyuan","html_url":"https://github.com/terrytangyuan","followers_url":"https://api.github.com/users/terrytangyuan/followers","following_url":"https://api.github.com/users/terrytangyuan/following{/other_user}","gists_url":"https://api.github.com/users/terrytangyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/terrytangyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrytangyuan/subscriptions","organizations_url":"https://api.github.com/users/terrytangyuan/orgs","repos_url":"https://api.github.com/users/terrytangyuan/repos","events_url":"https://api.github.com/users/terrytangyuan/events{/privacy}","received_events_url":"https://api.github.com/users/terrytangyuan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-30T01:21:38Z","updated_at":"2015-12-30T03:22:09Z","closed_at":"2015-12-30T02:59:26Z","body":"Maybe it's something I missed. I am very new to dask. But here's a reproducible example:\r\n\r\nDataset: dbpedia_csv.tar.gz\r\nhttps://drive.google.com/folderview?id=0Bz8a_Dbh9Qhbfll6bVpmNUtUcFdjYmF2SEpmZUZUcVNiMUw1TWN6RDV3a0JHT3kxLVhVR2M\r\n\r\n```\r\ndata = dd.read_csv('dbpedia_csv/train.csv', header=None)\r\ndata.divisions = tuple(range(1, len(data.divisions) + 1))  # assign divisions other than None\r\n```\r\n\r\n```\r\ndata.count().compute()\r\n0    560000\r\n1    560000\r\n2    560000\r\ndtype: int64\r\n```\r\nwhich is consistent with\r\n```\r\ndata[1].count().compute()\r\n\r\n560000\r\n```\r\nBut when `data.compute()`\r\nI got this:\r\n```\r\n0                                         E. D. Abbott Ltd\r\n1                                           Schwan-Stabilo\r\n2                                               Q-workshop\r\n3                        Marvell Software Solutions Israel\r\n4                              Bergan Mercy Medical Center\r\n5                                       The Unsigned Guide\r\n6                                        Rest of the world\r\n7                                               Globoforce\r\n8                                                Rompetrol\r\n9                                          Wave Accounting\r\n10                                      Angstrem (company)\r\n11                                         I-innovate (UK)\r\n12                                                     JVC\r\n13                                                Toei Bus\r\n14                                       Tear Drop Records\r\n15       Presses polytechniques et universitaires romandes\r\n16                                                Websense\r\n17                                 Adventist Health System\r\n18                                                CIB Bank\r\n19                                    Orfanato Music Group\r\n20                                        SCAN Health Plan\r\n21                                            Rudolf Kämpf\r\n22                                        De Wendel family\r\n23                              Mansfield Building Society\r\n24                                          Witcomb Cycles\r\n25                                     Goldilocks Bakeshop\r\n26                              Guardian Assurance Company\r\n27                                                  Shiply\r\n28                         Orange Music Electronic Company\r\n29                                       Rytec Corporation\r\n                               ...\r\n18629                                                  NME\r\n18630                                         The Londoner\r\n18631                          Formal Aspects of Computing\r\n18632                                            Hayom Yom\r\n18633                        Swords Against the Shadowland\r\n18634              Aruvu Rezuru: Kikaijikake no Yōseitachi\r\n18635                                    Tintin (magazine)\r\n18636                       The Tenth Man (Chayefsky play)\r\n18637                                    Dramatical Murder\r\n18638                 A Dictionary of Modern English Usage\r\n18639                                              Assayad\r\n18640                                     Loveless (manga)\r\n18641                                  The American Hebrew\r\n18642                                  Montanan (magazine)\r\n18643                                    Black Out (novel)\r\n18644                                 Gold Digger (comics)\r\n18645                               Dealer's Choice (play)\r\n18646                                       Phuket Gazette\r\n18647                            If I Forget Thee Oh Earth\r\n18648                        The Lincoln Conspiracy (book)\r\n18649                                   Endocrine Research\r\n18650                             A Thousand Splendid Suns\r\n18651                                       Western People\r\n18652                              Mademoiselle (magazine)\r\n18653                                  Scoliosis (journal)\r\n18654                                     Barking in Essex\r\n18655                                     Science & Spirit\r\n18656                               The Blithedale Romance\r\n18657                                  Razadarit Ayedawbon\r\n18658                             The Vinyl Cafe Notebooks\r\nName: 1, dtype: object\r\n```\r\nWhy isn't it 560000 but 18658? "},"comment":{"url":"https://api.github.com/repos/blaze/dask/issues/comments/167929941","html_url":"https://github.com/blaze/dask/issues/897#issuecomment-167929941","issue_url":"https://api.github.com/repos/blaze/dask/issues/897","id":167929941,"user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?v=3","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T03:22:09Z","updated_at":"2015-12-30T03:22:09Z","body":"Generally you should be aware that the dask.dataframe API is a subset of the Pandas API, which is much more heavily documented.  So a quick googling of \"combine a pandas series to a pandas dataframe\" is very likely to yield constructive results.\r\n\r\nYou may find the following Pandas doc page valuable http://pandas.pydata.org/pandas-docs/stable/merging.html .  I think that you're looking for `concat` with `axis=1`.\r\n\r\nAlternatively, you can use the same random seed in each of the sample calls.\r\n\r\n```python\r\nIn [1]: import pandas as pd\r\n\r\nIn [2]: df = pd.DataFrame({'x': list(range(100)), 'y': [i * 10 for i in range(100)]})\r\n\r\nIn [3]: df.head()\r\nOut[3]: \r\n   x   y\r\n0  0   0\r\n1  1  10\r\n2  2  20\r\n3  3  30\r\n4  4  40\r\n\r\nIn [4]: df.x.sample(frac=0.1, random_state=123)\r\nOut[4]: \r\n8      8\r\n70    70\r\n82    82\r\n28    28\r\n63    63\r\n0      0\r\n5      5\r\n50    50\r\n81    81\r\n4      4\r\nName: x, dtype: int64\r\n\r\nIn [5]: df.y.sample(frac=0.1, random_state=123)\r\nOut[5]: \r\n8      80\r\n70    700\r\n82    820\r\n28    280\r\n63    630\r\n0       0\r\n5      50\r\n50    500\r\n81    810\r\n4      40\r\nName: y, dtype: int64\r\n```"}}