Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #108605
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Michael Selik <michael.selik@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: How to put back a number-based index |
| Date | Fri, 13 May 2016 16:56:56 +0000 |
| Lines | 12 |
| Message-ID | <mailman.635.1463158627.32212.python-list@python.org> (permalink) |
| References | <1878444350.3064027.1463156091513.JavaMail.yahoo.ref@mail.yahoo.com> <1878444350.3064027.1463156091513.JavaMail.yahoo@mail.yahoo.com> <1974768074.3081564.1463156374539.JavaMail.yahoo@mail.yahoo.com> <CAGgTfkNC=aCkp+6TY3LxYe-EK5Ug64L-Qua_qVS70qPpfbbtvA@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| X-Trace | news.uni-berlin.de 21c0tjDFsyx9CKJN6lg2vQ4VG++nWErbX/Wc1sYCuofA== |
| Return-Path | <michael.selik@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.006 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'aggregate': 0.07; 'column': 0.07; 'subject:number': 0.07; 'subject:How': 0.09; 'indexes': 0.09; 'email addr:python.org>': 0.10; 'index': 0.13; '2016': 0.16; 'email addr:python.org>': 0.16; 'mean,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:based': 0.16; 'wrote:': 0.16; 'to:name:python-list@python.org': 0.20; 'to:2**1': 0.21; 'decide': 0.23; 'header:In-Reply-To:1': 0.24; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; '13,': 0.29; 'grouping': 0.29; 'handle': 0.34; 'received:google.com': 0.35; 'so,': 0.35; 'could': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'received:209.85.220': 0.38; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'back': 0.62; 'python-list': 0.66; 'email name:python-list': 0.67; 'column.': 0.84; 'max,': 0.84; 'to:addr:yahoo.co.uk': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=QguX8AMzi+qqNTEgYlHGjEINI3Bg9kqJ3tLyZaEtZc8=; b=bst45sqTPxLazzSYCaqFTen+xiTf+vn1T7x20rkxYgI9PjJso0+p91cVJQC56rP7UR PgW5kLdIq+ZkKeLQfg5iuiKS4L39gi6X/AtUBHyb37eI3RAgyaMA7JDBACfv3gLA1Dfh rBU6gu/KhZIrSxjYyspN045SYX2QYfqw1Wh7CusAIHyIA4REfxTLC4twGsq5qeuEj9gN EMx0NBVP3ER3Iks27UN41GMqavGULvqA8PNen+ALdicvHxtVJ3gy9Rwo1hjgE4/ZyjtD 8uVhjinBUtzgf2V2w2Pc7fXMq2TL9aaOw6qKGnY9nU5z7oloTT7ORFW0XXNbf3bEI9JA 3wvQ== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=QguX8AMzi+qqNTEgYlHGjEINI3Bg9kqJ3tLyZaEtZc8=; b=gHaCFo7jJ6mFfjRl1uOUf1HC2d9XJh2VcmymTRTxdtVcsCfA5+7hTbclg4Iv/0KdOB EyKhJMQL5jbxaLobXBPCXJIx11/mBAGd3eT+Sq1bFTMKuRGvFV41O3pqzXuw/w9Kkmor TkYtsOmu4oW/MOp3Kvo06G+1WgTR7zU7l4VG8Msl5ET5CpB01ia9Ee7ZmWtIMJuW0C1H Z1kc/VANDbzJm41K2eetdOjJE/2Z/4QSXa2z57aWA4NA4gJptwvUeGYUxoaY2HK8xq0B QuHl3SevZoaWZimYwkaQUT5EcOqLQI/RBwwdmBY4QUyZlN4NmAWRVDjBm3W5czeyiRMu ByHQ== |
| X-Gm-Message-State | AOPr4FVtzn3VATI6laqvP25MFqOYbD1kbXL8mMp7Hv5uF5sGmHq6e4SAWnyJdlXgqJ7Eridj8i4PyvwN+CavIA== |
| X-Received | by 10.55.151.199 with SMTP id z190mr16690538qkd.172.1463158625431; Fri, 13 May 2016 09:57:05 -0700 (PDT) |
| In-Reply-To | <1974768074.3081564.1463156374539.JavaMail.yahoo@mail.yahoo.com> |
| X-Content-Filtered-By | Mailman/MimeDel 2.1.22 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.22 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <CAGgTfkNC=aCkp+6TY3LxYe-EK5Ug64L-Qua_qVS70qPpfbbtvA@mail.gmail.com> |
| X-Mailman-Original-References | <1878444350.3064027.1463156091513.JavaMail.yahoo.ref@mail.yahoo.com> <1878444350.3064027.1463156091513.JavaMail.yahoo@mail.yahoo.com> <1974768074.3081564.1463156374539.JavaMail.yahoo@mail.yahoo.com> |
| Xref | csiph.com comp.lang.python:108605 |
Show key headers only | View raw
On Fri, May 13, 2016 at 12:27 PM David Shi via Python-list < python-list@python.org> wrote: > I lost my indexes after grouping in Pandas. > I managed to rest_index and got back the index column. > But How can I get back a index row? > Was the grouping an aggregation? If so, the original indexes are meaningless. What you could do is reset_index before the grouping and when you aggregate decide how to handle the formerly-known-as-index column (min, max, mean, ?).
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: How to put back a number-based index Michael Selik <michael.selik@gmail.com> - 2016-05-13 16:56 +0000
csiph-web