I am trying to search the following string in my pandas DataFrame but its not being able to find the string even though its present in the dataframe.  My code is:  df_temp = pd.DataFrame({'name' :['Wilkes, Mrs. James (Ellen Needs)']}) df_temp['name'].str.contains('Wilkes, Mrs. James (Ellen Needs)').sum()   This is giving me an output of zero where the expected output should be '1' . Is this because the string contains brackets or space or anything else? Is there a better method to search for strings in Pandas.  Any help would be really appreciated, Thankyou!
I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?
Find an explicit isomorphism of the map $h: \Bbb F_5[x]/(x^2+x+2) \to \Bbb F_5[x]/(x^2+4x+2)$  I take the question to mean showing the 2 rings are isomorphic by finding an explicit mapping of each element.   I think $x^2+x+2$ and $x^2+4x+2$ are irreducible over $\Bbb F_5$, so these are both fields.  Also $x^2=4x+3$ in the first case and $x^2=x+3$ in the second.  But beyond these basic facts I'm not sure how I should proceed. I am designing the layout for a touchscreen for outside use, What are some good color combination to use that will be visible under the sun light for outside use? Maybe bright neon colors? I would like a way to mark a question in the Unanswered "my tags" page as something I'm not interested in or able to answer The /unanswered/tagged?tab=mytags page gives a list of questions from my favorite tags that are currently considered "unanswered" - they have no up voted or accepted answers. I think it's good to put them in front of me easily, but even though they have one or more tags that I'm interested in, I may not have the knowledge, ability, or interest to write an answer to them. However, they will remain on this page until someone writes an answer.  I would like to be able to dismiss questions from views, like this one, that show me interesting questions. I may choose to share them on my social media to get them views and answers, but I don't want to continually see them. Instead, I want to be able to use views like unanswered/tagged?tab=mytags as a queue of things that could use my attention. Manganese has more unpaired electrons than Iron so why is Iron ferromagnetic Manganese paramagnetic? Manganese has five unpaired electrons, but Iron has four, then why is Iron ferromagnetic and Manganese paramagnetic? What's that property I'm missing? Force a browser to load the 'https' edition of a website, not the 'http'? Lightning component quick action - send parameters to the lightning component I have a lightning component that is available for use as lightning component quick action. I need to use this component from various object actions, for example, I will add a lightning component quick action to account object and to contact object. Now on the lightning component itself, I want to know if it was invoked from the account object or from the contact object, but I cannot find a way to do that. I have found a way to get the record Id by adding &lt;aura:attribute name=&quot;recordId&quot; type=&quot;String&quot; /&gt; (see code snippet below) It is working but not good enough. What I really need is to send a parameter from the lightning component quick action invocation:  And get it in my component: &lt;aura:component implements=&quot;force:lightningQuickAction,force:hasRecordId,flexipage:availableForAllPageTypes&quot;&gt;     &lt;aura:attribute name=&quot;recordId&quot; type=&quot;String&quot; /&gt;     &lt;aura:attribute name=&quot;param&quot; type=&quot;String&quot;/&gt; &lt;/aura:component&gt;  Is this possible? And if not - any workaround for achieving that? Is verifying ISOs downloaded from the official website worthwhile? I downloaded the ISO from , selecting the default "Ubuntu Desktop" option.  The website links the page  which gives instructions how to verify ubuntu.  This seems pretty tedious, and I am wondering how realistic it is that there is a problem with ISO downloaded from the official website. I note that the process of verification itself requires me to download software that is new to me, thus introducing another attack vector on me even as I am closing another one.  For what it's worth, I am planning to use Live USB only and not to fully install Ubuntu. Does that make a difference? How do I create a script file for terminal commands? In Windows I can write a file containing commands for cmd (usually .cmd or .bat files).  When I click on those files it will open cmd.exe and run them commands the file contains.  How would I do this in Ubuntu?         I'm sure this is a duplicate, but I can't find my answer. Its similar to these questions, but they don't answer the question: If $A \in M_{n}(\Bbb{R})$ is an Upper triangular matrix with diagonal entries $1$ such that  $A \neq I$, then what can we say about the diagonalizability of $A$ ?  I know that if the matrix has distinct eigenvalues or the set of eigenvectors are linearly independent then the matrix is diagonalizable.  And that the eigenvalues of the triangular matrices are given by the diagonal elements like  and , but they work nocely if we had distinct elements on the main diagonal.  But in my case I have same value 1 on the main diagonal, how can I approach about the diagonalizability of the matrix? Summary table with a field that shows components of each summarized record Show a matrix in detail Below it is a very useful command to create a matrix. But it has a short point to me since it shows Parentheses not Square brackets. My question it how should I change this to show square brackets? I appreciate your answer. Thank you so much.  \[ K =   \underbracket{\begin{pmatrix}    K_1 &amp; 0      &amp; 0    \\    0   &amp; \ddots &amp;    0   \\    0   &amp; 0      &amp; K_n    \\    \end{pmatrix}}_{d\times M} \] Suppose $p$ is a prime number such that $(p-1)/4$ and $(p+1)/2$ are also primes. Show that $p=13$ Suppose $p$ is a prime number such that $(p-1)/4$ and $(p+1)/2$ are also primes. Show that $p=13$.   My approach:   Since $p$ is prime, it is of the form $6k+1$ or $6k-1$. Now if $p$ is of the form $6k-1$ then $(p+1)/2 = 3k$ which is not possible as $3|3k$.   So $p$ is of the form $6k+1$. Now $(p-1)/4 = 3k/2$ so $2\mid k$. So $p$ is of the form $12k+1$. But now, how to prove $k=1$?  Please help! The Monty Hall problem In how many different ways can we place $8$ identical rooks on a chess board so that no two of them attack each other? In how many different ways can we place $8$ identical rooks on a chess board so that no two of them attack each other?  I tried to draw diagrams onto a $8\times8$ square but I'm only getting $16$ ways.  Does that sound right?  Thanks for the help! EM algorithm gaussian mixtures- derivation I'm trying to make sense of a derivation I'm following from the lecture notes of Stanford's ML course.  Specifically the notes are here:   I'm particular I'm interested in the step where they are optimizing the lower bound of the log-likelihood by finding the derivative of that function w.r.t the mean (top of page 7). I'm a bit stuck on going from line 1 to line 2 in that sequence.  To copy here (using abbreviated notation for space):  $$ \nabla \mu_s \sum_{i=1}^{m}\sum_{j=1}^{k} w_j^{(i)}\log\frac{\alpha_j \exp\psi_{j}^{(i)}\phi_j}{w_j^{(i)}}  \qquad(1) $$ $$ \nabla \mu_s \sum_{i=1}^{m}\sum_{j=1}^{k} w_j^{(i)}\psi_{j}^{(i)}\qquad(2) $$ where $\psi_{j}^{(i)} =-\frac{1}{2}(x^{(i)}-\mu_j)^T\Sigma^{-1}_{j}(x^{(i)}-\mu_j)$ and $\alpha_j=\frac{1}{(2\pi)^{n/2}|\Sigma_j|^{1/2}}$.  The quantity $\mu_s$ is the mean (of a multivariate gaussian distribution) for class $s$.    In short, I'm not sure how they get from (1) to (2).  From just changing the log of (1) I see:  $$ \nabla \mu_s \sum_{i=1}^{m}\sum_{j=1}^{k} w_j^{(i)}\log \left(\alpha_j \exp\psi_{j}^{(i)}\phi_j\right) - w_j^{(i)}\log w_j^{(i)} \qquad(1) $$  To get to their form (2) my impression is that they take pre-emptively discard terms that would contain derivatives of $w_j^{(i)}$ (w.r.t. $\mu_s$).  At least if you assume that much, you get to (2).  However, as they show earlier in that PDF,  $$ w_j^{(i)} = p(z^{(i)}=j | x^{(i)}) =\frac{p(x^{(i)}|z^{(i)}=j)p(z^{(i)}=j) }{\sum_j p(x^{(i)},z^{(i)}=j) } $$ i.e. this quantity is the posterior distribution of the class labels.  Intuitively, it seems like $\partial w_j^{(i)}/ \partial \mu_s$ should be non-zero.  After all, changing the location of the mean $\mu_s$ would change your posterior probability for a particular class given the same data.  (Right?).  Just from a mechanical point of view, $\partial w_j^{(i)}/\partial \mu_j$ would seemingly have some non-zero terms since $p(x^{(i)}|z^{(i)}=j) \sim \mathcal{N}(\mu_j, \Sigma_j)$.  If I work through the algebra, I get  $$ \frac{\partial w_j^{(i)}}{\partial \mu_j} = w_j^{(i)}(1-w_j^{(i)})\frac{\partial \psi^{(i)}_{j}}{\partial \mu_j} $$  What am I missing here?  If I take the log-likelihood (without even thinking about EM algorithm),    $$ \ell = \sum_{i=1}^{m}\log \sum_{j=1}^{k}p(x^{(i)}|z^{(i)}=j)p(z^{(i)}=j) $$ and differentiate w.r.t $\mu_s$, I correctly get  $$ \mu_s^* = \frac{\sum_{i=1}^{m}w_s^{(i)}x^{(i)}}{\sum_{i=1}^{m}w_s^{(i)}} $$  so I'm comfortable with the eventual result, just not the intermediate steps. How to fix task manager memory column if it shows lies I have a problem in showing memory in task manager with memory and paging columns. Why it shows so small size usage? And maybe anyone knows how to fix it?  Here is a screenshot(working set, memory, page pool) sorted by most consuming: How to prove or disprove following statement :     There are infinitely many primes of the form : $\lfloor \sqrt {3} \cdot n \rfloor $    Note: This is a problem I made myself.  There is a theorem that states :  $\lfloor nx \rfloor = \begin{cases}  n\lfloor x \rfloor, &amp; \text{if } 0 \leq \{x\} &lt; \frac{1}{n} \\  n\lfloor x \rfloor +1, &amp; \text{if } \frac{1}{n} \leq \{x\} &lt; \frac{2}{n} \\  n\lfloor x \rfloor +2, &amp; \text{if } \frac{2}{n} \leq \{x\} &lt; \frac{3}{n} \\  \vdots \\  n\lfloor x \rfloor +n-1, &amp; \text{if } \frac{n-1}{n} \leq \{x\} &lt; 1 \\ \end{cases}$  where $\{x\}$ is a non-integer part of $x$ .  Hence :  $\lfloor \sqrt{3}\cdot n \rfloor = \begin{cases}  n, &amp; \text{if } 0 \leq \sqrt{3}-1 &lt; \frac{1}{n} \\  n +1, &amp; \text{if } \frac{1}{n} \leq \sqrt{3}-1 &lt; \frac{2}{n} \\  n +2, &amp; \text{if } \frac{2}{n} \leq \sqrt{3}-1 &lt; \frac{3}{n} \\  \vdots \\  2n-1, &amp; \text{if } \frac{n-1}{n} \leq \sqrt{3}-1 &lt; 1 \\ \end{cases}$  How can I proceed from here ? Using memory with a higher MHz rating? Can MacBook Pro's successfully support and fully exploit RAM of a higher MHz rating than that which they ship with?    For example, take my 15" MacBook Pro () that ships with 4GB of 1333MHz DDR3 memory. I'm considering buying 16GB of the same clock speed even though Apple says that it can "support up to 8GB" — .  What about installing 1600MHz in the 16GB variant — will it work? Or will it be clocked down to 1333MHz? When compared to 16GB 1333MHz, will the higher clock speed improve battery life, performance, timings, or what? I am running k-fold cross validation on my training data, and then choosing the best set of hyper parameters, re-training on the training data and testing on a new (unseen) testing data. I am getting the following testing results (results on the unseen data):  R^2: 1.000 Adj R^2: 1.000 RMSE: 0.081 MSE: 0.007 MAE: 0.045 MAPE: 0.058   Can $R^2$ have a value of 1.00 but RMSE have a  value of 0.081? Doesn't an $R^2$ of value 1 indicate no errors at all? How to deploy wsp to single web application