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
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
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
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 in Pandas. But
> > it does not
> >
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
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 can
>> be connected to or not
>
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
> 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
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:
urllib.request.urlope
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:
10 matches
Mail list logo