Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #5491

Re: [Python-de] Anfaengerfrage: Dataframe - Zeilenmittel - Spaltenmittel

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Julian Gethmann <mail.python.org@gethmann.org>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] Anfaengerfrage: Dataframe - Zeilenmittel - Spaltenmittel
Date Tue, 18 Jun 2019 09:35:56 +0200
Lines 48
Message-ID <mailman.136.1560843960.21674.python-de@python.org> (permalink)
References <1825444.o0KX4FVeTt@host> <a4f8939d-7c1d-4168-cd66-fbba20fa1ff9@sschwarzer.net> <6641ea97-84df-43ed-fd81-dd7acbe8e6e1@gethmann.org>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
X-Trace news.uni-berlin.de iUM8f4w4i1UpD6G/+5ZCygmRh1r2f4g2kZGNUhy6G8Wg==
Return-Path <mail.python.org@gethmann.org>
X-Original-To python-de@python.org
Delivered-To python-de@mail.python.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0
In-Reply-To <a4f8939d-7c1d-4168-cd66-fbba20fa1ff9@sschwarzer.net>
Content-Language en-US
X-BeenThere python-de@python.org
X-Mailman-Version 2.1.29
Precedence list
List-Id Die Deutsche Python Mailingliste <python-de.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-de>, <mailto:python-de-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-de/>
List-Post <mailto:python-de@python.org>
List-Help <mailto:python-de-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-de>, <mailto:python-de-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <6641ea97-84df-43ed-fd81-dd7acbe8e6e1@gethmann.org>
X-Mailman-Original-References <1825444.o0KX4FVeTt@host> <a4f8939d-7c1d-4168-cd66-fbba20fa1ff9@sschwarzer.net>
Xref csiph.com de.comp.lang.python:5491

Show key headers only | View raw


Hallo,

On 17/06/2019 23.39, Stefan Schwarzer wrote:
> On 2019-06-17 22:37, eilfh wrote:
>> hallo,
>> dumme Frage
> 
> es gibt keine dummen Fragen, nur dumme Antworten. :-)
> 
>> Anfängerfrage
>> find einfach keine passende Lösung
>>
>> ungefähr so
>>
>>
>> for i in spalte_nr:
>>      for j in zeilen_nr:
>>          DataFrame_1 = DataFrame -
>> 			Zeilen_mittel(DataFrame[j]) -
>> 			Spalte_mittel(DataFrame[i])
>>
>> Die Komponenten der Berechnung hab ich zwar, aber in der doppelten for-
>> Schleife gelingt mir das einfach nicht.
> 
> Ich bin mir nicht ganz sicher, was du meinst bzw. was du
> erreichen willst. (Ich habe nur eine vage Ahnung, bin mir aber
> nicht sicher, ob ich damit richtig liege.) Kannst deine Absicht
> genauer beschreiben, vielleicht mit einem Beispiel?
> 
> Was sind die "DataFrame"-Objekte im obigen Code für Objekte?
falls du Pandas DataFrames meinst, hätte ich eine, wenn auch nicht so 
schöne, Lösung, die NumPys broadcasting nutzt:

```
 >>> df = pd.DataFrame({"c1": list(range(10)), "c2": list(range(10,20))})
 >>> (np.mean(np.array(df), axis=1).reshape(-1,1) - 
np.mean(np.array(df), axis=0).reshape(1,-1))
```

Viele Grüße,
Julian
> 
> Viele Grüße
> Stefan
> _______________________________________________
> python-de maillist  -  python-de@python.org
> https://mail.python.org/mailman/listinfo/python-de
> 

Back to de.comp.lang.python | Previous | Next | Find similar


Thread

Re: [Python-de] Anfaengerfrage: Dataframe - Zeilenmittel - Spaltenmittel Julian Gethmann <mail.python.org@gethmann.org> - 2019-06-18 09:35 +0200

csiph-web