I have a list as follow:  list1 = [['10', 'John', 'python'], ['1', 'Sara', 'java'], ['3','Tom', 'C']]   and as sorted result I expect following outpt:  3 Tom C 1 Sara Java 10 John python   in fact I want to sort it base on second parameter in internal list. This code does not work:  sort1 = sorted(list1, key=lambda x: x[0][1])
I have the following data structure (a list of lists)  [  ['4', '21', '1', '14', '2008-10-24 15:42:58'],   ['3', '22', '4', '2somename', '2008-10-24 15:22:03'],   ['5', '21', '3', '19', '2008-10-24 15:45:45'],   ['6', '21', '1', '1somename', '2008-10-24 15:45:49'],   ['7', '22', '3', '2somename', '2008-10-24 15:45:51'] ]   I would like to be able to   Use a function to reorder the list so that I can group by each item in the list. For example I'd like to be able to group by the second column (so that all the 21's are together)  Use a function to only display certain values from each inner list. For example i'd like to reduce this list to only contain the 4th field value of '2somename'    so the list would look like this   [      ['3', '22', '4', '2somename', '2008-10-24 15:22:03'],       ['7', '22', '3', '2somename', '2008-10-24 15:45:51'] ]
How to code an automated bot that can browse and do operations on a webpage Where did object dimensions go in 2.8? Anyone seen this panel? Essential for precise modeling. Edit:  I foolishly changed my example right before posting this. The following is what I meant to ask.  On the wikipedia page below, it says "a non-zero non-unit element in an integral domain is said to be irreducible if it is not a product of two non-units."   Then, on the wikipedia page below, it says "an irreducible polynomial is, roughly speaking, a non-constant polynomial that cannot be factored into the product of two non-constant polynomials."   The page then gives an example of a polynomial that is irreducible "over the rationals" (I assume it is implied that "the integers" is referring to the ring of polynomials over the field of rationals, right?)  $p(x) = x^2 + 2 = (x+\sqrt{2})(x-\sqrt{2})$  On the Wofram page below, it says "the irreducible polynomials are examples of irreducible elements."   If irreducible polynomials are a subset of irreducible elements, how is $x+\sqrt{2}$ a unit?  What can it be multiplied by to equal the multiplicative identity?  I think I have it right this time (sorry. long day)  ====================================================================  The following is the original post (for those who already responded and those looking at the corresponding responses)  On the wikipedia page below, it says "a non-zero non-unit element in an integral domain is said to be irreducible if it is not a product of two non-units."   Then, on the wikipedia page below, it says "an irreducible polynomial is, roughly speaking, a non-constant polynomial that cannot be factored into the product of two non-constant polynomials."   The page then gives an example of a polynomial that is reducible "over the integers" (I assume it is implied that "the integers" is referring to some sort of ring, right? due to the claim below)  $p(x) = x^2 + 4x + 4 = (x+2)(x+2)$  On the Wofram page below, it says "the irreducible polynomials are examples of irreducible elements."   If irreducible polynomials are a subset of irreducible elements, how is $x+2$ a unit?  What can it be multiplied by to equal the multiplicative identity? I'm playing on a Survival world with cheats on, "easy" difficulty, and at night in-game. I didn't have a sword or anything to make a sword with, and I was starving, so I switched to Creative to give myself a stack of food and a bed to set my spawn point. When I switched back to Survival, I couldn't destroy or place blocks. I'm on single player, and my Internet is fine, and I can destroy blocks still if I switch to creative. I've tried resetting the button one, and reloading the map, and it still doesn't work. I've even tried deleting everything I gave myself in Creative. This happened before on a different world and I ended up deleting it.  This only happens on this world. How do I fix it?  If I know I'm in the correct game mode, what else can cause this?  Are there different causes in multiplayer? graphics with \setbeamercovered{transparent} With \setbeamercovered{transparent} covered parts of a slide are displayed transparently. If there is a (small) picture among the text, it is shown as it is. Beamer has only this picture, so it shows this picture. My question: How can I give a gray version of the picture to beamer such that in covered parts of a slide, this gray version is used? Remount squashfs root filessytem read-write I am working on an embedded device. The fstab shows the following info:  &lt;file system&gt; &lt;mount pt&gt;      &lt;type&gt;  &lt;options&gt;         &lt;dump&gt; &lt;pass&gt; /dev/root       /               ext2    rw,noauto                           0               1 proc            /proc           proc    defaults                            0               0 devpts          /dev/pts        devpts  defaults,gid=5,mode=620             0               0 tmpfs           /tmp            tmpfs   defaults                            0               0 ramfs           /var            ramfs   defaults                            0               0 sys             /sys            sysfs   defaults                            0               0   Running the mount command I get this:  rootfs on / type rootfs (rw) /dev/root on / type squashfs (ro,relatime) proc on /proc type proc (rw,relatime) sys on /sys type sysfs (rw,relatime) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620) ramfs on /var type ramfs (rw,relatime)   Which means that the root filesystem is read-only.  How can I remount the read-only part as read-write? Some vertices don't move along with the rig Custom hard edges in Blender How to parse hex values into a uint? uint color;  bool parsedhex = uint.TryParse(TextBox1.Text, out color);  //where Text is of the form 0xFF0000 if(parsedhex)    //...   doesn't work. What am i doing wrong? how can we show $\frac{\pi^2}{8} = 1 + \frac1{3^2} +\frac1{5^2} + \frac1{7^2} + …$? Let $f(x) = \frac4\pi \cdot (\sin x + \frac13 \sin (3x) + \frac15 \sin (5x) + \dots)$. If for $x=\frac\pi2$, we have $$f(x) = \frac{4}{\pi} ( 1 - \frac13 +\frac15 - \frac17 + \dots) = 1$$ then obviously :  $$ 1 - \frac13 +\frac15 - \frac17 + \dots=\frac{\pi}{4}$$ Now how can we prove that: $$\frac{\pi^2}{8} = 1 + \frac1{3^2} +\frac1{5^2} + \frac1{7^2} + \dots$$ My PC has both Ubuntu and Windows 7 installed. I have installed all my drivers in Windows like Nvidia graphics, motherboard etc. Shall I install them in Ubuntu too?  I looked on the web for my Nvidia drivers and I have found a .run file. How could I install it on my Ubuntu? What happens if 2 separate abilities require you to sacrifice a creature? Sum : $\sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)^3}$ Why were there 3-7-9 Rings of Power? LaTeX conditional expression I would like to be able to set a flag at the beginning of the main flag (say output) that tells if I want to produce a paper document or an electronic document.   Then I should check this flag to define or not empty pages, hypperref, oneside or twosides, etc.  How could I do that ? Controlling Volume Mixer Finding out the area of a triangle if the coordinates of the three vertices are given What is the simplest way to find out the area of a triangle if the coordinates of the three vertices are given in $x$-$y$ plane?   One approach is to find the length of each side from the coordinates given and then apply . Is this the best way possible?   Is it possible to compare the area of triangles with their coordinates provided without actually calculating side lengths? How can I fix a 404 Error when using a PPA or updating my package lists? How to prove that the radial basis function is a kernel? How to prove that the radial basis function $k(x, y) = \exp(-\frac{||x-y||^2)}{2\sigma^2})$ is a kernel? As far as I understand, in order to prove this we have to prove either of the following:   For any set of vectors $x_1, x_2, ..., x_n$ matrix $K(x_1, x_2, ..., x_n)$ = $(k(x_i, x_j))_{n \times n}$ is positive semidefinite. A mapping $\Phi$ can be presented such as $k(x, y)$ = $\langle\Phi(x), \Phi(y)\rangle$.   Any help? Prove: $\binom{n}{0}F_0+\binom{n}{1}F_1+\binom{n}{2}F_2+\cdots+\binom{n}{n}F_n=F_{2n}$ Prove: $\binom{n}{0}F_0+\binom{n}{1}F_1+\binom{n}{2}F_2+\cdots+\binom{n}{n}F_n=F_{2n}$;  I was stuck with this question for a while... Help me please!!! Thanks!!!