RE: How to apply a self defined function in Pandas

2021-10-31 Thread Avi Gross via Python-list
it for them, as in some asking about HW. I am not joining this one. 😉 -Original Message- From: Python-list On Behalf Of Karsten Hilbert Sent: Sunday, October 31, 2021 4:00 PM To: python-list@python.org Subject: Re: How to apply a self defined function in Pandas Am Sun, Oct 31, 2021 at

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
On Sun, 31 Oct 2021 at 18:42, Shaozhong SHI wrote: > > > On Sunday, 31 October 2021, Albert-Jan Roskam > wrote: > >> >> >> > df['URL'] = df.apply(lambda x: connect(df['URL']), axis=1) >> >> >> I think you need axis=0. Or use the Series, df['URL'] = >> df.URL.apply(connect) >> > > Just experime

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Karsten Hilbert
Am Sun, Oct 31, 2021 at 07:52:18PM + schrieb Shaozhong SHI: > Well, can you expand the the simplicity? Not sure how expanding is going to help but here's one way to do it: Python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] on linux Type "help", "copyr

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
On Sun, 31 Oct 2021 at 19:28, MRAB wrote: > On 2021-10-31 18:48, Shaozhong SHI wrote: > > > > On Sunday, 31 October 2021, MRAB wrote: > > > > On 2021-10-31 17:25, Shaozhong SHI wrote: > > > > I defined a function and apply it to a column

Re: How to apply a self defined function in Pandas

2021-10-31 Thread MRAB
On 2021-10-31 18:48, Shaozhong SHI wrote: On Sunday, 31 October 2021, MRAB wrote: On 2021-10-31 17:25, Shaozhong SHI wrote: I defined a function and apply it to a column in Pandas.  But it does not return correct values. I am trying to test which url in a

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
On Sunday, 31 October 2021, MRAB wrote: > On 2021-10-31 17:25, Shaozhong SHI wrote: > >> I defined a function and apply it to a column in Pandas. But it does not >> return correct values. >> >> I am trying to test which url in a column full of url to see which one

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
On Sunday, 31 October 2021, Albert-Jan Roskam wrote: > > > > df['URL'] = df.apply(lambda x: connect(df['URL']), axis=1) > > > I think you need axis=0. Or use the Series, df['URL'] = > df.URL.apply(connect) > Any details? I will try and let you know. Regards, David -- https://mail.python.org/ma

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Albert-Jan Roskam
> df['URL'] = df.apply(lambda x: connect(df['URL']), axis=1) I think you need axis=0. Or use the Series, df['URL'] = df.URL.apply(connect) -- https://mail.python.org/mailman/listinfo/python-list

Re: How to apply a self defined function in Pandas

2021-10-31 Thread MRAB
On 2021-10-31 17:25, Shaozhong SHI wrote: I defined a function and apply it to a column in Pandas. But it does not return correct values. I am trying to test which url in a column full of url to see which one can be connected to or not def connect(url): try

How to apply a self defined function in Pandas

2021-10-31 Thread Shaozhong SHI
I defined a function and apply it to a column in Pandas. But it does not return correct values. I am trying to test which url in a column full of url to see which one can be connected to or not def connect(url): try: urllib.request.urlopen(url) return True except

Re: To apply pca for a large csv

2020-04-14 Thread Oscar Benjamin
On Tue, 14 Apr 2020 at 12:42, Rahul Gupta wrote: > > Hello all, i have a csv of 1 gb which consists of 25000 columns and 2 > rows. I want to apply pca so i have seen sciki-learn had inbuilt > fucntionality to use that. But i have seen to do eo you have to load data in > dat

Re: To apply pca for a large csv

2020-04-14 Thread Rahul Gupta
64 bit version -- https://mail.python.org/mailman/listinfo/python-list

Re: To apply pca for a large csv

2020-04-14 Thread Chris Angelico
On Tue, Apr 14, 2020 at 9:41 PM Rahul Gupta wrote: > > Hello all, i have a csv of 1 gb which consists of 25000 columns and 2 > rows. I want to apply pca so i have seen sciki-learn had inbuilt > fucntionality to use that. But i have seen to do eo you have to load data in >

To apply pca for a large csv

2020-04-14 Thread Rahul Gupta
Hello all, i have a csv of 1 gb which consists of 25000 columns and 2 rows. I want to apply pca so i have seen sciki-learn had inbuilt fucntionality to use that. But i have seen to do eo you have to load data in data frame. But my machine is i5 with 8 gb of ram which fails to load all this

Re: Help!!! How to apply my created function to another function

2019-03-10 Thread Gregory Ewing
djoy...@gmail.com wrote: def buildVector(v) : print(v[0],v[1],v[2]) If you want to be able to use the result of this function in another computation, you need to return it, not print it: def buildVector(v) : return (v[0],v[1],v[2]) Similarly with buildRandomVector and vectorMagnitude

Re: Help!!! How to apply my created function to another function

2019-03-10 Thread DL Neil
Luuk, On 11/03/19 8:02 AM, Luuk wrote: On 10-3-2019 19:30, djoy...@gmail.com wrote: Please see the last line When reading above, i was thinking about this joke: ...> ;) Yes, I had a similar reaction to the wording: why not put *it* first. Having lived and worked in many countries/culture

Re: Help!!! How to apply my created function to another function

2019-03-10 Thread Luuk
perfectly corrected that means my function create right. But when I try to put vectorMagnitude(B) which I was thinking to put new list from buildRandomVector(A),it returns an error. I have been attempting to import buildRandomVector(A) to a list, but I can not understand why the list can not apply

Re: Help!!! How to apply my created function to another function

2019-03-10 Thread DL Neil
Dear Joyce, On 11/03/19 7:30 AM, djoy...@gmail.com wrote: ... A = [ 4, 5, 1] #TASK0 def displayVector(v) : print(v) displayVector(A) ... B = buildRandomVector(A) def vectorMagnitude(v) : tsum = 0 for i in v: tsum = tsum + i**2 x = math.sqrt(tsum)

Help!!! How to apply my created function to another function

2019-03-10 Thread djoyceb
buildRandomVector(A) to a list, but I can not understand why the list can not apply to vectorMagnitude(B). Can you assist me in figuring the problem? Thank you!! A = [ 4, 5, 1] #TASK0 def displayVector(v) : print(v) displayVector(A) #TASK1 def buildVector(v) : print(v[0],v[1],v[2

Re: How to apply filters to posts

2018-06-14 Thread Cameron Simpson
On 14Jun2018 19:42, Dennis Lee Bieber wrote: On Fri, 15 Jun 2018 05:39:08 +1000, Ben Finney declaimed the following: Don't choose the daily digest, because it makes a special “digest” message for you each day. That message is disconnected from any other message, and so you will not be able to

Re: How to apply filters to posts

2018-06-14 Thread Ben Finney
Dennis Lee Bieber writes: > On Fri, 15 Jun 2018 05:39:08 +1000, Ben Finney > declaimed the following: > > >Don't choose the daily digest, because it makes a special “digest” > >message for you each day. That message is disconnected from any other > >message, and so you will not be able to reply

Re: How to apply filters to posts

2018-06-14 Thread Cameron Simpson
On 14Jun2018 09:23, Tamara Berger wrote: Thanks, Rhodri. One more question. What is a daily digest? I'm wondering whether to choose that option. Please don't use the digest mode. They're a terrible way to read lists, and an even worse way to participate - your replies will never be correctly

Re: How to apply filters to posts

2018-06-14 Thread Mark Lawrence
he mailing list (and thus you will start receiving posts), which also entitles you to send to the list. Sending email to that address will send it to the list. So what you're seeing is not options, but steps - first you subscribe, then you send email. OK. And can you tell me how to apply

Re: How to apply filters to posts

2018-06-14 Thread T Berger
On Thursday, June 14, 2018 at 3:39:44 PM UTC-4, Ben Finney wrote: > T Berger writes: > > > Thanks, Rhodri. One more question. What is a daily digest? I'm > > wondering whether to choose that option. > > Don't choose the daily digest, because it makes a special “digest” > message for you each day

Re: How to apply filters to posts

2018-06-14 Thread Ben Finney
T Berger writes: > Thanks, Rhodri. One more question. What is a daily digest? I'm > wondering whether to choose that option. Don't choose the daily digest, because it makes a special “digest” message for you each day. That message is disconnected from any other message, and so you will not be ab

Re: How to apply filters to posts

2018-06-14 Thread T Berger
he > >> mailing list (and thus you will start receiving posts), which also > >> entitles you to send to the list. Sending email to that address will > >> send it to the list. So what you're seeing is not options, but steps - > >> first you subscribe, then yo

Re: How to apply filters to posts

2018-06-14 Thread Rhodri James
ending email to that address will send it to the list. So what you're seeing is not options, but steps - first you subscribe, then you send email. OK. And can you tell me how to apply filters so that only replies to my emails are included. I subscribed to the list a couple of weeks ago and then

Re: How to apply filters to posts

2018-06-14 Thread T Berger
ss will > send it to the list. So what you're seeing is not options, but steps - > first you subscribe, then you send email. OK. And can you tell me how to apply filters so that only replies to my emails are included. I subscribed to the list a couple of weeks ago and then had to unsub

Re: How to apply filters to posts

2018-06-14 Thread Chris Angelico
On Thu, Jun 14, 2018 at 3:47 PM, T Berger wrote: > On Tuesday, April 10, 2018 at 1:21:53 AM UTC-4, Chris Angelico wrote: > >> I recommend, instead, joining the mailing list: >> >> https://mail.python.org/mailman/listinfo/python-list > > There seem to be two options on the Python-list Information P

Re: How to apply filters to posts

2018-06-13 Thread T Berger
On Tuesday, April 10, 2018 at 1:21:53 AM UTC-4, Chris Angelico wrote: > I recommend, instead, joining the mailing list: > > https://mail.python.org/mailman/listinfo/python-list There seem to be two options on the Python-list Information Page. * Subscribe to the list (see sections below) * Sen

Re: How to apply filters to posts

2018-04-09 Thread Chris Angelico
On Tue, Apr 10, 2018 at 3:10 PM, T Berger wrote: > This is the first time I've joined a google group and I don't understand the > setup. Why are most of the posts in this group unrelated to python, and how > do I filter this junk (sorry) out? > Probably most of them ARE junk. Google Groups has

How to apply filters to posts

2018-04-09 Thread T Berger
This is the first time I've joined a google group and I don't understand the setup. Why are most of the posts in this group unrelated to python, and how do I filter this junk (sorry) out? -- https://mail.python.org/mailman/listinfo/python-list

Re: How to apply LR over gridded time series datasets ?

2018-03-29 Thread Dan Stromberg
On Wed, Mar 28, 2018 at 7:18 PM, wrote: > Hello all, > > This code is written for multivariate (multiple independent variables > x1,x2,x3..xn and a dependent variable y) time series analysis using logistic > regression (correlation and prediction). > This code is based on one point location (o

How to apply LR over gridded time series datasets ?

2018-03-28 Thread shalu . ashu50
Hello all, This code is written for multivariate (multiple independent variables x1,x2,x3..xn and a dependent variable y) time series analysis using logistic regression (correlation and prediction). #Import Libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd #Impo

Re: Pandas to_html cannot apply style

2017-10-30 Thread zljubisic
> This is not an in-place operation: it returns a style which you can then > render. > > style = df.style.apply(function2, axis=1) > html = style.render() > > appears to work. After your suggestion, rows are properly colored, but now I have lost all table lines, font is smaller... Is there an o

Re: Pandas to_html cannot apply style

2017-10-30 Thread zljubisic
> This is not an in-place operation: it returns a style which you can then > render. > > style = df.style.apply(function2, axis=1) > html = style.render() > > appears to work. This was a missing link. Thank you very very much Thomas. Regards and best wishes. -- https://mail.python.org/mailm

Re: Pandas to_html cannot apply style

2017-10-30 Thread Thomas Jollans
On 30/10/17 08:44, zljubi...@gmail.com wrote: > Hi, > > the following code never applies style and I cannot figure out why. > Can someone please help? > > import pandas as pd > > def function2(row): > if row.A == True: > color = '#FF' > else: > color = '#00FF00' > >

Pandas to_html cannot apply style

2017-10-30 Thread zljubisic
Hi, the following code never applies style and I cannot figure out why. Can someone please help? import pandas as pd def function2(row): if row.A == True: color = '#FF' else: color = '#00FF00' background_color = 'background-color: {}'.format(color) return [b

Re: Unable to apply stop words in Pandas dataframe

2017-06-26 Thread Miki Tebeka
Can you show us some of the code you tried? On Monday, June 26, 2017 at 10:19:46 AM UTC+3, Bhaskar Dhariyal wrote: > Hi everyone! > > I have a dataset which I want to make model trainable. I ahve been trying to > do some thing for past 2-3 days. > > Actually I wanted to clean 'desc' and 'keywo

Unable to apply stop words in Pandas dataframe

2017-06-26 Thread Bhaskar Dhariyal
Hi everyone! I have a dataset which I want to make model trainable. I ahve been trying to do some thing for past 2-3 days. Actually I wanted to clean 'desc' and 'keywords' column from the dataset. I am using NLTK to vectorize, than remove stopwords & alpha numeric values and do stemming. More

Re: How to properly apply OOP in the bouncing ball code

2015-05-13 Thread Gregory Ewing
Terry Reedy wrote: On 5/11/2015 8:42 PM, zipher wrote: Huh? VPython successfully models particle motion simulation with discrete events. That's a discrete approximation to a continuous process. The term "discrete event simulation" is usually used to mean modelling a process that is inherently

Re: How to properly apply OOP in the bouncing ball code

2015-05-12 Thread Oscar Benjamin
On 11 May 2015 at 16:22, Tommy C wrote: > Thanks for your help. > > I have updated the code as follows, there are no more errors but the images > will not move at all, as all the images are staying at the upper left corner. > Please advice, thanks. > > > import sys, pygame > > pygame.init() > >

Re: How to properly apply OOP in the bouncing ball code

2015-05-12 Thread Terry Reedy
On 5/11/2015 8:42 PM, zipher wrote: On Monday, May 11, 2015 at 7:25:09 PM UTC-5, Dennis Lee Bieber wrote: On Mon, 11 May 2015 08:33:56 -0700 (PDT), zipher declaimed the following: You are making a error that few in the programming community have caught up to. OOP design for *data abstraction

Re: How to properly apply OOP in the bouncing ball code

2015-05-11 Thread zipher
On Monday, May 11, 2015 at 7:25:09 PM UTC-5, Dennis Lee Bieber wrote: > On Mon, 11 May 2015 08:33:56 -0700 (PDT), zipher > declaimed the following: > >You are making a error that few in the programming community have caught up > >to. OOP design for *data abstraction* is a completely different be

Re: How to properly apply OOP in the bouncing ball code

2015-05-11 Thread zipher
On Friday, May 8, 2015 at 10:40:46 AM UTC-5, Tommy C wrote: > I'm trying to apply OOP in this bouncing ball code in order to have multiple > balls bouncing around the screen. The objective of this code is to create a > method called settings, which controls all the settings for

Re: How to properly apply OOP in the bouncing ball code

2015-05-11 Thread Tommy C
.jpg") patrick.speed[0] = 5 patrick.speed[1] = 8 patrick.control() patrick.settings() jaws = BALL("jaws.jpg") jaws.speed[0] = 1 jaws.speed[1] = 10 jaws.control() jaws.settings() On Friday, May 8, 2015 at 11:40:46 AM UTC-4, Tommy C wrote: > I'm trying to apply OOP in this bou

Re: How to properly apply OOP in the bouncing ball code

2015-05-08 Thread Mel Wilson
On Fri, 08 May 2015 08:40:34 -0700, Tommy C wrote: > I'm trying to apply OOP in this bouncing ball code in order to have > multiple balls bouncing around the screen. The objective of this code is > to create a method called settings, which controls all the settings for > t

Re: How to properly apply OOP in the bouncing ball code

2015-05-08 Thread Ian Kelly
On May 8, 2015 9:46 AM, "Tommy C" wrote: > > I'm trying to apply OOP in this bouncing ball code in order to have multiple balls bouncing around the screen. The objective of this code is to create a method called settings, which controls all the settings for the screen and t

How to properly apply OOP in the bouncing ball code

2015-05-08 Thread Tommy C
I'm trying to apply OOP in this bouncing ball code in order to have multiple balls bouncing around the screen. The objective of this code is to create a method called settings, which controls all the settings for the screen and the bouncing behaviour of multiple balls, under the class

Re: How to apply python patch for issue9729

2015-02-24 Thread Grant Edwards
On 2015-02-24, Chris Angelico wrote: > On Tue, Feb 24, 2015 at 8:09 AM, Sada Shirol wrote: >> Upon some research found that I need to apply below patch: >> >> http://bugs.python.org/issue9729 >> >> How do I apply a patch to python 2.6.6 on Linux? > > Hmm.

Al madinah international university opening apply for university colleges (September season)

2014-07-27 Thread marketing . team
quality control and efficiency Academy, known for short as [MQA ] to congratulate you on the occasion of the new academic September year - 2014 . Its pleasure to tell you that the university opening apply for university colleges. The flowing colleges : * faculty of Islamic Sciences

Al madinah international university opening apply for university colleges (September season)

2014-06-16 Thread Marwa Kotb
quality control and efficiency Academy, known for short as [MQA ] to congratulate you on the occasion of the new academic September year - 2014 . Its pleasure to tell you that the university opening apply for university colleges. The flowing colleges : * faculty of Islamic Sciences * faculty

Al madinah international university opening apply for university colleges (September season)

2014-06-12 Thread Marwa Kotb
quality control and efficiency Academy, known for short as [MQA ] to congratulate you on the occasion of the new academic September year - 2014 . Its pleasure to tell you that the university opening apply for university colleges. The flowing colleges : * faculty of Islamic Sciences * faculty

Al madinah international university opening apply for university colleges

2014-02-20 Thread Marwa Kotb
quality control and efficiency Academy, known for short as [MQA ] to congratulate you on the occasion of the new academic February year - 2014 . Its pleasure to tell you that the university opening apply for university colleges. The following colleges : * Faculty of Islamic Sciences

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-18 Thread Neil Cerutti
s Python > a dysfunctional programming language to apply FP? Can the more > experienced Python users advise? I recommend Scheme to learn functional programming style. There's a short scheme tutorial that was entered in the Interactive Fiction competition in 1998 or so. You can play it o

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Ryan
language for FP. I am sort >of confused at the moment. Is Python a dysfunctional programming >language to apply FP? Can the more experienced Python users advise? >-- >https://mail.python.org/mailman/listinfo/python-list -- Sent from my Android phone with K-9 Mail. Please excuse

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Rustom Mody
confused > at the moment. Is Python a dysfunctional programming language to apply FP? > Can the more experienced Python users advise? For many years I taught programming in which a pure functional language was the 'mother-tongue' and was followed by a multi-paradigm language. In the

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Chris Angelico
On Mon, Feb 17, 2014 at 12:20 AM, Mark Lawrence wrote: > On 16/02/2014 08:00, Pat Johnson wrote: >> >> This made me grin. ;) >> > > What did, using google groups? :) "Well! I've often seen context without a grin," thought Alice; "but a grin without context! It's the most curious thing I ever saw

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Mark Lawrence
On 16/02/2014 08:00, Pat Johnson wrote: This made me grin. ;) What did, using google groups? :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Terry Reedy
. I am sort of confused at the moment. Is Python a dysfunctional programming language to apply FP? Can the more experienced Python users advise? Everything about FP that can be done in, say, Scheme, can be done in Python, with the exception of tail recursion (but that isn't important You c

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-16 Thread Pat Johnson
This made me grin. ;) -- https://mail.python.org/mailman/listinfo/python-list

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-15 Thread Chris Angelico
On Sun, Feb 16, 2014 at 5:38 PM, Devin Jeanpierre wrote: > Otherwise you will likely be confused when you overhear functional > programmers talking, whether it's about Hindley-Milner or sum types or > eta conversion. ETA conversion? I know what that is. That's when a programmer says something'll

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-15 Thread Devin Jeanpierre
e moment. Is Python a dysfunctional programming language to apply FP? > Can the more experienced Python users advise? Everything about FP that can be done in, say, Scheme, can be done in Python, with the exception of tail recursion (but that isn't important for "real" FP). But

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-15 Thread Ben Finney
Python code *and* your understanding of functional programming. > I am sort of confused at the moment. Is Python a dysfunctional > programming language to apply FP? Can the more experienced Python > users advise? I think if you want to learn functional programming you should have a good r

Re: Can one use Python to learn and even apply Functional Programming?

2014-02-15 Thread Chris Angelico
e moment. Is Python a dysfunctional programming language to apply FP? > Can the more experienced Python users advise? > Functional programming is a particular style. Python supports some of that style, but it certainly doesn't enforce it; if you want to learn how to work within a fun

Can one use Python to learn and even apply Functional Programming?

2014-02-15 Thread Sam
I would like to learn and try out functional programming (FP). I love Python and would like to use it to try FP. Some have advised me to use Haskell instead because Python is not a good language for FP. I am sort of confused at the moment. Is Python a dysfunctional programming language to apply

Re: Ways to apply while learning....

2013-01-30 Thread Ritchie Flick
It's perfectly normal that you need to look things up, even the most seasoned programmer has to look up something at some point. Finding small projects is often difficult, because many projects grow to such an extent, that they're simply to difficult to grasp for a beginner and even for an experie

Re: Ways to apply while learning....

2013-01-29 Thread David Hutto
On Tue, Jan 29, 2013 at 5:57 PM, wrote: > Hello, > I am learning programming as a spare time hobby and learning python through > codecademy. > > Today I have downloaded and installed aptana, and found out that although I > have been progressing for some time now but I do not remember how to cod

Ways to apply while learning....

2013-01-29 Thread agamal100
Hello, I am learning programming as a spare time hobby and learning python through codecademy. Today I have downloaded and installed aptana, and found out that although I have been progressing for some time now but I do not remember how to code and I have to look everything up. I want to know

Re: How to apply the user's HTML environment in a Python programme?

2012-10-02 Thread Ramchandra Apte
On Monday, 1 October 2012 19:49:27 UTC+5:30, BobAalsma wrote: > Op vrijdag 21 september 2012 16:15:30 UTC+2 schreef Joel Goldstick het > volgende: > > > On Fri, Sep 21, 2012 at 9:58 AM, BobAalsma wrote: > > > > > > > Op vrijdag 21 september 2012 15:36:11 UTC+2 schreef Jerry Hill het > > > vo

Re: How to apply the user's HTML environment in a Python programme?

2012-10-01 Thread BobAalsma
Op vrijdag 21 september 2012 16:15:30 UTC+2 schreef Joel Goldstick het volgende: > On Fri, Sep 21, 2012 at 9:58 AM, BobAalsma wrote: > > > Op vrijdag 21 september 2012 15:36:11 UTC+2 schreef Jerry Hill het volgende: > > >> On Fri, Sep 21, 2012 at 9:31 AM, BobAalsma wrote: > > >> > > >> > Thanks

Re: How to apply the user's HTML environment in a Python programme?

2012-09-22 Thread Thomas Jollans
On 09/21/2012 02:57 PM, BobAalsma wrote: > I'd like to write a programme that will be offered as a web service (Django), > in which the user will point to a specific URL and the programme will be used > to read the text of that URL. > > This text can be behind a username/password, but for severa

Re: How to apply the user's HTML environment in a Python programme?

2012-09-22 Thread BobAalsma
Op vrijdag 21 september 2012 22:10:04 UTC+2 schreef Dennis Lee Bieber het volgende: > On Fri, 21 Sep 2012 09:36:08 -0400, Jerry Hill > > declaimed the following in gmane.comp.python.general: > > > > > On Fri, Sep 21, 2012 at 9:31 AM, BobAalsma wrote: > > > > Thanks, Joel, yes, but as far as I

Re: How to apply the user's HTML environment in a Python programme?

2012-09-22 Thread BobAalsma
Op vrijdag 21 september 2012 17:28:02 UTC+2 schreef David Smith het volgende: > On 2012-09-21 08:57, BobAalsma wrote: > > > This text can be behind a username/password, but for several reasons, I > > don't want to know those. > > > > > > So I would like to set up a situation where the user logs

Re: How to apply the user's HTML environment in a Python programme?

2012-09-21 Thread David Smith
On 2012-09-21 08:57, BobAalsma wrote: This text can be behind a username/password, but for several reasons, I don't want to know those. So I would like to set up a situation where the user logs in (if/when appropriate), points out the URL to my programme and my programme would then be able to

Re: How to apply the user's HTML environment in a Python programme?

2012-09-21 Thread Peter Otten
BobAalsma wrote: > Hmm, from the previous posts I get the impression that I could best solve > this by asking the user for the specific combination of username, password > and URL + promising not to keep any of that... > > OK, that does sound doable - thank you all Hmm, promising seems doable, b

Re: How to apply the user's HTML environment in a Python programme?

2012-09-21 Thread Joel Goldstick
On Fri, Sep 21, 2012 at 9:58 AM, BobAalsma wrote: > Op vrijdag 21 september 2012 15:36:11 UTC+2 schreef Jerry Hill het volgende: >> On Fri, Sep 21, 2012 at 9:31 AM, BobAalsma wrote: >> >> > Thanks, Joel, yes, but as far as I'm aware these would all require the >> > Python programme to have the us

Re: How to apply the user's HTML environment in a Python programme?

2012-09-21 Thread BobAalsma
Op vrijdag 21 september 2012 15:36:11 UTC+2 schreef Jerry Hill het volgende: > On Fri, Sep 21, 2012 at 9:31 AM, BobAalsma wrote: > > > Thanks, Joel, yes, but as far as I'm aware these would all require the > > Python programme to have the user's username and password (or > > "credentials"), whic

Re: How to apply the user's HTML environment in a Python programme?

2012-09-21 Thread Jerry Hill
On Fri, Sep 21, 2012 at 9:31 AM, BobAalsma wrote: > Thanks, Joel, yes, but as far as I'm aware these would all require the Python > programme to have the user's username and password (or "credentials"), which > I wanted to avoid. No matter what you do, your web service is going to have to authe

Re: How to apply the user's HTML environment in a Python programme?

2012-09-21 Thread BobAalsma
Op vrijdag 21 september 2012 15:23:14 UTC+2 schreef Joel Goldstick het volgende: > On Fri, Sep 21, 2012 at 8:57 AM, BobAalsma wrote: > > > I'd like to write a programme that will be offered as a web service > > (Django), in which the user will point to a specific URL and the programme > > will b

Re: How to apply the user's HTML environment in a Python programme?

2012-09-21 Thread Joel Goldstick
On Fri, Sep 21, 2012 at 8:57 AM, BobAalsma wrote: > I'd like to write a programme that will be offered as a web service (Django), > in which the user will point to a specific URL and the programme will be used > to read the text of that URL. > > This text can be behind a username/password, but f

How to apply the user's HTML environment in a Python programme?

2012-09-21 Thread BobAalsma
I'd like to write a programme that will be offered as a web service (Django), in which the user will point to a specific URL and the programme will be used to read the text of that URL. This text can be behind a username/password, but for several reasons, I don't want to know those. So I woul

Re: Fastest way to apply a function to an iterable

2010-05-26 Thread Stefan Behnel
Shashank Singh, 26.05.2010 23:16: > I probably didn't state the problem properly. I was assuming the > availability of a static method that could be passed on to map based > solution (or imap for that matter). > > The question was, if one wants to apply a function on each

Re: Fastest way to apply a function to an iterable

2010-05-26 Thread Shashank Singh
or imap for that matter). The question was, if one wants to apply a function on each member of list and discard the return value, is it possible to do it more efficiently than having a for loop in python and applying the function of each of the members? Take this run: from itertools import ima

Re: Fastest way to apply a function to an iterable

2010-05-26 Thread Peter Otten
> But some people may consider this too ugly to actually use in real code. Which doesn't mean it can't get worse: >>> from sys import maxint >>> from operator import attrgetter >>> from itertools import imap, islice >>> class I: ... def __init

Re: Fastest way to apply a function to an iterable

2010-05-26 Thread Stefan Behnel
Shashank Singh, 26.05.2010 21:48: What is the most efficient way of applying a function to all the elements of an iterable while discarding the result (i.e. operations are done only for side-effects). For example if I want to save all elements in a list of items (and am not interested in what sa

Fastest way to apply a function to an iterable

2010-05-26 Thread Shashank Singh
What is the most efficient way of applying a function to all the elements of an iterable while discarding the result (i.e. operations are done only for side-effects). For example if I want to save all elements in a list of items (and am not interested in what save() returns), the simplest way is:

Re: sort array, apply rearrangement to second

2010-04-01 Thread Steve Howell
On Mar 31, 1:09 pm, Raymond Hettinger wrote: > On Mar 30, 4:25 pm, s...@sig.for.address (Victor Eijkhout) wrote: > > > I have two arrays, made with numpy. The first one has values that I want > > to use as sorting keys; the second one needs to be sorted by those keys. > > Obviously I could turn th

Re: sort array, apply rearrangement to second

2010-03-31 Thread Raymond Hettinger
On Mar 30, 4:25 pm, s...@sig.for.address (Victor Eijkhout) wrote: > I have two arrays, made with numpy. The first one has values that I want > to use as sorting keys; the second one needs to be sorted by those keys. > Obviously I could turn them into a dictionary  of pairs and sort by the > first m

Re: sort array, apply rearrangement to second

2010-03-31 Thread Steve Holden
Victor Eijkhout wrote: > Robert Kern wrote: > >> second[first.argsort()] > > Really cool. Thanks. > >> Ask numpy questions on the numpy mailing list. > > I will. I thought that this question would have an answer in a generic > python idiom. > > Victor. Not an unreasonable assumption, but it

Re: sort array, apply rearrangement to second

2010-03-31 Thread Robert Kern
On 2010-03-31 13:58 PM, Victor Eijkhout wrote: Robert Kern wrote: second[first.argsort()] Really cool. Thanks. Ask numpy questions on the numpy mailing list. I will. I thought that this question would have an answer in a generic python idiom. When dealing with numpy arrays, the generic

Re: sort array, apply rearrangement to second

2010-03-31 Thread Victor Eijkhout
Robert Kern wrote: > second[first.argsort()] Really cool. Thanks. > Ask numpy questions on the numpy mailing list. I will. I thought that this question would have an answer in a generic python idiom. Victor. -- Victor Eijkhout -- eijkhout at tacc utexas edu -- http://mail.python.org/mailman

Re: sort array, apply rearrangement to second

2010-03-30 Thread Robert Kern
On 2010-03-30 18:25 , Victor Eijkhout wrote: I have two arrays, made with numpy. The first one has values that I want to use as sorting keys; the second one needs to be sorted by those keys. Obviously I could turn them into a dictionary of pairs and sort by the first member, but I think that's n

Re: sort array, apply rearrangement to second

2010-03-30 Thread Chris Colbert
On Tue, Mar 30, 2010 at 9:59 PM, Chris Colbert wrote: > > > On Tue, Mar 30, 2010 at 7:25 PM, Victor Eijkhout wrote: > >> I have two arrays, made with numpy. The first one has values that I want >> to use as sorting keys; the second one needs to be sorted by those keys. >> Obviously I could turn t

Re: sort array, apply rearrangement to second

2010-03-30 Thread Chris Colbert
On Tue, Mar 30, 2010 at 7:25 PM, Victor Eijkhout wrote: > I have two arrays, made with numpy. The first one has values that I want > to use as sorting keys; the second one needs to be sorted by those keys. > Obviously I could turn them into a dictionary of pairs and sort by the > first member, bu

Re: sort array, apply rearrangement to second

2010-03-30 Thread MRAB
Victor Eijkhout wrote: I have two arrays, made with numpy. The first one has values that I want to use as sorting keys; the second one needs to be sorted by those keys. Obviously I could turn them into a dictionary of pairs and sort by the first member, but I think that's not very efficient, at

Re: sort array, apply rearrangement to second

2010-03-30 Thread Steve Holden
Victor Eijkhout wrote: > I have two arrays, made with numpy. The first one has values that I want > to use as sorting keys; the second one needs to be sorted by those keys. > Obviously I could turn them into a dictionary of pairs and sort by the > first member, but I think that's not very efficien

Re: sort array, apply rearrangement to second

2010-03-30 Thread Alf P. Steinbach
* Victor Eijkhout: I have two arrays, made with numpy. The first one has values that I want to use as sorting keys; the second one needs to be sorted by those keys. Obviously I could turn them into a dictionary of pairs and sort by the first member, but I think that's not very efficient, at leas

sort array, apply rearrangement to second

2010-03-30 Thread Victor Eijkhout
I have two arrays, made with numpy. The first one has values that I want to use as sorting keys; the second one needs to be sorted by those keys. Obviously I could turn them into a dictionary of pairs and sort by the first member, but I think that's not very efficient, at least in space, and this

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Carl Banks
On Sep 9, 8:14 pm, Steven D'Aprano wrote: > On Wed, 09 Sep 2009 14:58:22 -0700, Carl Banks wrote: > > Use case seems perfectly obvious to me.  You have a set of functions > > that use different strategies to accomplish a task, and there is a lot > > of overlap in the arguments used but no consiste

  1   2   3   >