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


Groups > comp.lang.python > #94819

Re: How to rearrange array using Python?

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Martin Schöön <martin.schoon@gmail.com>
Newsgroups comp.lang.python
Subject Re: How to rearrange array using Python?
Date 31 Jul 2015 20:53:45 GMT
Organization @ Home
Lines 37
Message-ID <d225ipFr1aeU2@mid.individual.net> (permalink)
References <d1vftgF65svU1@mid.individual.net> <mpeid2$8va$1@news.albasani.net>
Mime-Version 1.0
Content-Type text/plain; charset=utf8
Content-Transfer-Encoding 8bit
X-Trace individual.net Likv79GaBPP9yBwJOrvpfg8RDb6HK6uMSyTrlGl3adN6eCOsAQ
Cancel-Lock sha1:OhB7E0HTz+ZE8995umIKpvpjLag=
User-Agent slrn/pre1.0.0-18 (Linux)
Xref csiph.com comp.lang.python:94819

Show key headers only | View raw


Den 2015-07-31 skrev Robin Koch <robin.koch@t-online.de>:
> Am 30.07.2015 um 22:31 schrieb Martin Schöön:
>
>> Scores to the right show how many wishes are fulfilled in each room
>
> Is it possible the is a mistake in the sum column on the third row?
> Should the be a 1?

Indeed.
>
>> The goal is to re-shuffle the array to maximize this score.
>>
>> How do I go about doing that?
>
> Depending on how you store those wishes I'd think you can use
> random.shuffle()!?

When cruising the net yesterday I came across this and it looked to me
it does re-shuffle arrays but not in a way that helps me. Maybe I
am wrong.
>
> But do you think simply maximising the score is the optimal solution to 
> the problem?

It is a start. The result will no doubt need some human post-processing.
I am merely hoping to eliminate the grunt-work.

(There will be pre-processing too, correcting misspelled names etc...)

> That way some kids will get their both wishes fulfilled (s, e and p in 
<snip>
> kids picking each other. Another thing one might want to takeinto 
> account. :-))
>
I did hint at differences between my example and the real problem...

/Martin

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

How to rearrange array using Python? Martin Schöön <martin.schoon@gmail.com> - 2015-07-30 20:31 +0000
  Re: How to rearrange array using Python? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-30 23:21 +0100
    Re: How to rearrange array using Python? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-31 04:29 +0200
      Re: How to rearrange array using Python? Martin Schöön <martin.schoon@gmail.com> - 2015-07-31 20:40 +0000
        Re: How to rearrange array using Python? Martin Schöön <martin.schoon@gmail.com> - 2015-08-17 21:14 +0000
  Re: How to rearrange array using Python? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-30 23:41 +0100
  Re: How to rearrange array using Python? Robin Koch <robin.koch@t-online.de> - 2015-07-31 03:18 +0200
    Re: How to rearrange array using Python? Martin Schöön <martin.schoon@gmail.com> - 2015-07-31 20:53 +0000

csiph-web