Python divide dataframe into chunks
How do you split a list into evenly sized chunks?
Proving the given quadratic form is chi-squared $k$ Suppose $\underline{X}$ is an $m$-dimensional vector following multivariate Normal distribution i.e. $\underline{X}$~$N_m(\underline{\mu},\Sigma)$ where $\Sigma$ is positive definite. Let $B$ be a symmetric $m$ by $m$ matrix, having the following properties:  $B\Sigma B=B$  $\underline{\mu}'B\underline{\mu}=0$  $trace(B\Sigma)=k$, where $k&lt;m$   Prove that $\underline{X}'B\underline{X}$ follows chi-squared ($k$).  I proceeded a lot but got stuck in one last step where I think linear algebra is troubling me. Kindly have  a look at my &quot;solution&quot;.  The second condition can be written as $\underline{\mu}'B\Sigma B\underline{\mu}=0\implies B\underline{\mu}=\underline{0}$ as $\Sigma$ is Positive definite. Then after a little algebra and considering condition 2, we can write $\underline{X}'B\underline{X}=(\underline{X}-\underline{\mu})'B(\underline{X}-\underline{\mu})=(\underline{X}-\underline{\mu})'B\Sigma B(\underline{X}-\underline{\mu})$ But $\Sigma$ is positive definite hence we can have a symmetric matrix $\sqrt{\Sigma}$ defined such that $\sqrt{\Sigma}\sqrt{\Sigma}=\Sigma$. Using this, we can write $(\underline{X}-\underline{\mu})'B\Sigma B(\underline{X}-\underline{\mu})=(\sqrt{\Sigma}B(\underline{X}-\underline{\mu}))'(\sqrt{\Sigma}B(\underline{X}-\underline{\mu}))$ We want to show that this follows chi-squared ($k$). Now, it is obvious that as $(\underline{X}-\underline{\mu})$~$N(\underline{0},\Sigma)$, $\sqrt{\Sigma}B(\underline{X}-\underline{\mu})$~$N(\underline{0},\sqrt{\Sigma}B\Sigma B\sqrt{\Sigma})=N(\underline{0},\sqrt{\Sigma}B\sqrt{\Sigma})$ Now, $trace(\sqrt{\Sigma}B\sqrt{\Sigma})=trace(B\Sigma)=k$ and $\sqrt{\Sigma}B\sqrt{\Sigma}$ is idempotent (verified). So its eigenvalues are only $0$ or $1$. Since its trace is $k$, there are $k$ eigenvalues with value $1$ and other $m-k$ eigenvalues are $0$. Now here is the thing I want to prove: I want to show that$\sqrt{\Sigma}B\sqrt{\Sigma}$, which is the covariance matrix, is diagonal and has only $k$ $1$'s and remaining $m-k$ diagonal entries $0$. The reason is, then I will be able to say that $k$ components of $\sqrt{\Sigma}B(\underline{X}-\underline{\mu})$ are independent standard normals whose sum of squares is our quadratic form and thus it follows chi-squared ($k$). But I really could not show that $\sqrt{\Sigma}B\sqrt{\Sigma}$ has the desired property i.e. it is diagonal with rank $k$. But this is crucial, it is the finale. If this does not happen, then some components will be correlated with each other and we cannot say that our quadratic form has chi-squared ($k$). I would really appreciate if someone helped me to prove this final part. Show Log of the Sql statements that QGIS generates to retrieve Data from Postgis Is there a ways to  - make QGis log its generated SQL Statement or to - force POSTGIS to log all interaction with QGIS?  There is something strange happening to the WFS layer I retrieve in QGIS, since it does  not select all data available in the respective database table. I need to find out, what criteria QGIS chooses in order to narrow down the select set. I am monitoring the number of pages indexed by Googlebot for one of my websites .  I noticed that since last week, the number of pages has dropped by about 60 or so. Now to be fair, I have not added that much over the last week. (Actually I don't think I added any new content.) But at the very least, I would have thought that the number of indexed pages would be static (if I was not adding anything new.)  I don't understand why the numbers have dropped.  Does anyone have an official explanation for this?. I have checked the Google Webmaster Tools, and have not come across anything that addresses this issue directly. Why does the version of Java verified by Oracle differ from the version shown at the command line? I recall from complex analysis a while ago that the series $$\sum_{n=1}^\infty \frac{z^{n!}}{n}$$ has radius of convergence 1, diverges on roots of unity, and converges elsewhere on the circle. It's simple enough to see that it has to diverge on roots of unity: consider $z$ such that $z^k = 1$ for some $k \in \mathbb{N}.$ Plug this into the series and you see that past the $k$'th term, $z^{n!} = (z^k)^m = 1$ for some $m \in \mathbb{N}$; hence, the series becomes harmonic and must diverge.  But I don't recall how to show that the series converges for other values on the circle. If this is simple I'd like just a hint, if it is involved I would prefer a sparse outline of the proof. Thank you! We consider $g : (t,u,v)\in \mathbb{R}^3 \mapsto (t^2,u^2,v^2,\sqrt{2}uv, \sqrt{2}tv,\sqrt{2}tu)\in\mathbb{R}^6$. I have to prove that $g(\mathbb{S}^2)$ is a submanifold of $\mathbb{R}^6$.  $dg_{(t,u,v)}=\begin{pmatrix}2t&amp;0&amp;0\\  0&amp;2u&amp;0\\  0&amp;0&amp;2v\\  0&amp;\sqrt{2}v&amp;\sqrt{2}u\\ \sqrt{2}v&amp;0&amp;\sqrt{2}t\\ \sqrt{2}u&amp;\sqrt{2}t&amp;0\\ \end{pmatrix} $  So it proves that $g$ is an immersion (the rank is $3$ clearly) for $(\mathbb{R}^3-\{(0,0,0)\})$.  Now how to prove that $\mathbb{S}^2$ is homeomorphic to $g(\mathbb{S}^2)$ ? I must prove that $g$ is injective  ?  Thanks in advance ! Find the value of $\left[\frac{1}{\sqrt 2}+\frac{1}{ \sqrt 3}+......+\frac{1}{\sqrt {1000}}\right]$ Find the value of $$\left[\frac{1}{\sqrt 2}+\frac{1}{\sqrt 3}+.....+\frac{1}{\sqrt {1000}}\right]$$.Where [•] denote the greatest integer function.   I am very confused about this problem. I tried to find the upper and lower bound of the function. But I can't find any formulas to find the bounds. Somebody please help me. Can't execute terminal commands: "the command 'sudo' is available in '/usr/bin/sudo'" Emacs: Symbol's value as variable is void Understanding complete separation for logistic regression Why does logistic regression not converge for a linearly separable data set?   For linear separable data sets the model parameters go to infinity when mimizing the error function (according to Bishop2006, Pattern recognition and machine learning, section 4.3.2). I don't understand why. It must be connected to setting the score function, i.e. the derivative of the error function, to zero.  The error function is given by $E(\mathbf{w})$ as shown in the figure below. Where $\mathbf{t}$ is the target variable vector of the training set and $\mathbf{w}$ the parameter / coefficient vector. The posterior probabiltiy for class 1 is given by  $$y(n) = p(C_1|\mathbf{x}_n) = \sigma(\mathbf{w}'\mathbf{x}_n).$$ Where sigma is the logistic sigmoid function and $\mathbf{x}_n$ is the feature vector for instance $n$ including the predictors.     My second question to logistic regression is if the to posterior probabilities $p(C_1|\mathbf{x}_n)$ and $p(C_2|\mathbf{x}_n)$ sum to one? Why can't I update my Nexus 4 to Lollipop? As I understand it, Android Lollipop (5.0) is now generally available over-the-air. My Nexus 4 briefly offered for an hour or two to install it. I said yes, and watched it start to download. When I next went to unlock my phone, it obviously wasn't installed. Now, when I go into the Settings app, and manually check for updates, it says my phone is up-to-date. It's still on Android 4.4.4.  I don't particularly want to install the developer image, as that'll wipe all the data from my phone. Is there any way I can encourage it to update?  I'm in the UK, if it's relevant. Why is 4 not an instance of Number? Let $R$ be an integral domain. If $x \in R$ is prime, then $x$ is irreducible. References to a comment on a deleted answer can break Stack Exchange JS For the following URL, JavaScript breaks:  https://stackoverflow.com/questions/16356382/splitting-a-braces-grouped-string-in-python/16356421?noredirect=1#comment23433042_16356421   This is a link to a , the answer I can see as a 10K+ user (although users &lt;10k ).  With Chrome (26, Mac OS X) the console sez:  Uncaught TypeError: Cannot call method 'replace' of undefined   for line 83 of full.js.  Firefox (20, Mac still), the web console spits out:  [12:48:28.459] TypeError: c.attr(...) is undefined @ http://cdn.sstatic.net/js/full.js?v=c9131e40e3fb:83   Safari (6.0.4 on, you guessed it, Mac OS X) has this to complain about:  TypeError: 'undefined' is not an object (evaluating 'c.attr("id").replace')   for line 83 of full.js.  Because of this, the Answer text box on Stack Overflow is lacking all niceties such as an actual WMD editor.  If you remove the hash reference #comment23433042_16356421 from the end of the URL, things work again. Removing the ?noredirect=1 query parameter makes no difference. Was Elrond, in Tolkien's opinion, more inherently powerful than Galadriel? I always thought it was the other way around, but then I read this (Letter 246):     "Of the others only Gandalf might be expected to master him – being an emissary of the Powers and a creature of the same order, an immortal spirit taking a visible physical form. In the 'Mirror of Galadriel', 1381, it appears that Galadriel conceived of herself as capable of wielding the Ring and supplanting the Dark Lord. If so, so also were the other guardians of the Three, especially Elrond. But this is another matter. It was part of the essential deceit of the Ring to fill minds with imaginations of supreme power."   This "especially Elrond" confuses me. I don´t think that Elrond is inherently more powerful than Galadriel, who is described as the greatest of the Noldor, except for Fëanor (and possibly even his equal).  A quote from Unfinished Tales says:     "...In this he (Tolkien) emphasized the commanding stature of   Galadriel already in Valinor, the equal if unlike endowments of   Fëanor; and it is said here that so far from joining in Fëanor's   revolt she was in every way opposed to him."   Furthermore,      "A queen she was of the woodland Elves, the wife of Celeborn of   Doriath, yet she herself was of the Noldor and remember the Day before   days in Valinor, and she was the mightiest and fairest (so even   fairer than Arwen I would guess) of all the Elves that remained in   Middle-earth."   (The Silmarillion, of the Rings of Power)  And again...     "Galadriel was the greatest of the Noldor, except Fëanor maybe, though   she was wiser than he, and her wisdom increased with the long years."   (the Shibboleth of Fëanor)  Restating it:     "These two kinsfolk (Fëanor and Galadriel), the greatest of the   Eldar in Valinor, were unfriends for ever." "Who together with the   greatest of all the Eldar, Luthien Tinuviel, daughter of Elu Thingol,   are the chief matter of the legends and histories of the Elves."   (Unfinished Tales)  The latter means that Luthien, Fëanor and Galadriel are the chief matter of the history and legends. It seems to me that Tolkien thought of those three as the creme de la creme of the elven crop.  Reading all that I have serious problems believing that Elrond could be superior to her. As great as Elrond is, descending from Melian, he is no equal of Fëanor, who is said to be the mightiest of all elves, and if Galadriel is his equal, then there is no way that Elrond would be mightier than her.  Maybe I just read this "especially Elrond" wrong; it could as well mean that especially Elrond was deceived into thinking that he could master the ring, because that was the deceit of the ring. And Tolkien said explicitly that only Gandalf could possibly master it.  So, what do you think? Since it seems to me, that a lot of people still need sidebar workarounds, I would be interested to learn about the use-cases, experienced challenges and (most important) possible strategies to avoid them by using different approaches. This is related to the methods discussed here:   In my experience there are a few extremely important and constantly repeating patterns, which to my knowledge are still very hard to be solved using more official techniques. I will also contribute my own top-N use-cases, which are mostly related to UX and UI concerns. You are very welcome to add your own scenarios as answers and add comments on how you would avoid a workaround. My dream would be to team-elaborate strong and repeatable solution-patterns for the most common use-cases.  Finally I would be interested in the experiences of all of you who participate in the Aura pilot, which hopefully could make this kind of workarounds obsolete. I'm preparing for my exam, but I have difficulties in perceiving why there is a $\frac{1}{2}$ in the distance formula $d=\frac{1}{2}at^2$? What is the closest general-relativistic equivalent of a "time slice"? In a newtonian universe, one can talk of a "time slice", that is, the state of the universe at a given point in (global) time. In a "typical" classical universe, a time slice would contain enough information to fully compute the state of the universe at any other point in time, backwards or forwards.  So, disregarding what we know of quantum effects and talking purely of a general-relativistic universe, which concept is closest to a time slice? FFmpeg get duration of video file without meta data I got a video file which has no meta data.  If I do this for example:  ffmpeg -i test.m2v   I get these values:  Duration: N/A, bitrate: N/A   Is there still a way to get the duration of the video / .m2v file ?  Edit:  The full console output:  ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers   built with gcc 5.2.0 (GCC)   configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfr eetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enab le-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib   libavutil      54. 31.100 / 54. 31.100   libavcodec     56. 60.100 / 56. 60.100   libavformat    56. 40.101 / 56. 40.101   libavdevice    56.  4.100 / 56.  4.100   libavfilter     5. 40.101 /  5. 40.101   libswscale      3.  1.101 /  3.  1.101   libswresample   1.  2.101 /  1.  2.101   libpostproc    53.  3.100 / 53.  3.100 Input #0, mpegvideo, from '.\Test.m2v':   Duration: N/A, bitrate: N/A     Stream #0:0: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7000 kb/s, 25 fps, 25 tbr, 1200k tbn, 50 tbc Was The Empire in Star Wars inspired by Nazi Germany?