the memorize function you make gets
relatively few requests that are identical, it may not be worthwhile.
-Original Message-
From: Python-list On
Behalf Of MRAB via Python-list
Sent: Sunday, March 31, 2024 3:24 PM
To: python-list@python.org
Subject: Re: Can you help me with this
On 2024-03-31 09:04, marc nicole wrote:
Thanks for the first comment which I incorporated
but when you say "You can't use a list as a key, but you can use a
tuple as a key,
provided that the elements of the tuple are also immutable."
does it mean the result of sum of the array is not conveni
Thanks for the first comment which I incorporated
but when you say "You can't use a list as a key, but you can use a tuple as
a key,
provided that the elements of the tuple are also immutable."
does it mean the result of sum of the array is not convenient to use as
key as I do?
Which tuple I sho
On 2024-03-31 00:09, marc nicole via Python-list wrote:
I am creating a memoization example with a function that adds up / averages
the elements of an array and compares it with the cached ones to retrieve
them in case they are already stored.
In addition, I want to store only if the result of t
I am creating a memoization example with a function that adds up / averages
the elements of an array and compares it with the cached ones to retrieve
them in case they are already stored.
In addition, I want to store only if the result of the function differs
considerably (passes a threshold e.g.
Well, although I never used pandas and never will, if that's about
artworks, that's mine.
Obviously, you need to iterate columns and sum values returned by the
snippet you provided. A quick search tells us to use colums property.
So, it might look like this:
na_sum = sum(df[name].isnull().su
For a python class I am taking..
In this challenge, you'll be working with a DataFrame that contains data
about artworks, and it contains many missing values.
Your task is to create a variable called na_sum that contains the total
number of missing values in the DataFrame. When that's completed,
chovd...@gmail.com writes:
> Hi friends
>
> help me with the following code. Im able to execute the code but getting
> wrong output
>
> def sequence_b(N):
> N = 10
> result = 0
> for k in xrange (1,N):
> result += ((-1) ** (k+1))/2*k-1
> print result
> print sequenc
On 2013-11-06, Denis McMahon wrote:
> On Wed, 06 Nov 2013 00:35:56 +0200, Nick the Gr33k wrote:
>
>> Now i realizes i just cannot store lists into it's columns because it
>> does not support a collection datatype.
>
> All databases support storing of collections, but *NOT THE WAY YOU WANT
> TO DO
On Wed, Nov 6, 2013 at 3:49 AM, Mark Lawrence wrote:
> On 06/11/2013 01:14, Nick the Gr33k wrote:
>>
>>
>> How, do i i proceed?
>
>
> If at first you don't succeed, keep asking on comp.lang.python until someone
> gives me the completely bodged solution that I keep asking for even if it's
> complet
On 06/11/2013 01:14, Nick the Gr33k wrote:
How, do i i proceed?
If at first you don't succeed, keep asking on comp.lang.python until
someone gives me the completely bodged solution that I keep asking for
even if it's complete nonsense.
--
Python is the second best programming language in t
Op 05-11-13 22:26, Nick the Gr33k schreef:
> I know i'm close to solution, i can feel it but i have some issues.
> The code we arr discussing is the following:
No you are not. You are just doing random changes, without any
understanding. If you had followed my suggestion and actually
read the doc
On Tue, 5 Nov 2013 17:51:00 -0800 (PST), chovd...@gmail.com wrote:
result += ((-1) ** (k+1))/2*k-1
One of two things are happening here. Maybe both.
You're using Python 2.x (and should havesaid so) where integer
division is truncated.
You're missing around some part of the intende
On Tue, 05 Nov 2013 17:51:00 -0800, chovdary wrote:
> Hi friends
>
> help me with the following code. Im able to execute the code but getting
> wrong output
[snip code]
You have this critical expression in your code:
result += ((-1) ** (k+1))/2*k-1
It looks to me like you are using Python 2
On 06/11/2013 01:51, chovd...@gmail.com wrote:
Hi friends
help me with the following code. Im able to execute the code but getting wrong
output
def sequence_b(N):
N = 10
result = 0
for k in xrange (1,N):
result += ((-1) ** (k+1))/2*k-1
print result
print sequ
chovd...@gmail.com writes:
> def sequence_b(N):
> N = 10
> result = 0
> for k in xrange (1,N):
> result += ((-1) ** (k+1))/2*k-1
Every number here is an integer. Python 2 will keep all the computations
integers by default::
$ python2
>>> 1 / 2
0
You want to use
Hi friends
help me with the following code. Im able to execute the code but getting wrong
output
def sequence_b(N):
N = 10
result = 0
for k in xrange (1,N):
result += ((-1) ** (k+1))/2*k-1
print result
print sequence_b(10)
This is the output which im getting
-1
-4
Denis McMahon writes:
> You have been told several times by several people how to do this
> properly. You insist on using your bodged up solution instead. OK, we'll
> all try and help you bodge up a solution[…]
Why? No-one here is obligated to help with implementing a solution we
agree is bad.
Στις 6/11/2013 12:54 πμ, ο/η John Gordon έγραψε:
The code i provided only worked once before it failed and managed to
store this:
counterID,host,refs,city,userOS,browser,visits,hits,download
-
1, 176-92-96-218.adsl.cyta.gr, Euro
On Wed, 06 Nov 2013 00:35:56 +0200, Nick the Gr33k wrote:
> Now i realizes i just cannot store lists into it's columns because it
> does not support a collection datatype.
All databases support storing of collections, but *NOT THE WAY YOU WANT
TO DO IT*
You refuse to do it the proper way, so yo
On 05/11/2013 22:31, Cameron Simpson wrote:
On 05Nov2013 20:09, Nikos wrote:
O even better an rdbms than allows complex data such as tuples,
lists, dicts to be saved into the db as they are so i dont have to
cobvet back and forth each time.
If you're just using the db for storage or adhoc and
There is also the shelve module.
It uses pickle to marshal a Python object, then stores it in a file
under a key.
Sample code from the module documentation:
import shelve
d = shelve.open(filename) # open -- file may get suffix added by
low-level library
d[key] = data # store data at key
On 05Nov2013 20:09, Nikos wrote:
> O even better an rdbms than allows complex data such as tuples,
> lists, dicts to be saved into the db as they are so i dont have to
> cobvet back and forth each time.
If you're just using the db for storage or adhoc and arbitrary
python objects (and not queryin
In Nick the Gr33k
writes:
> The code i provided only worked once before it failed and managed to
> store this:
>
> counterID,host,refs,city,userOS,browser,visits,hits,download
> -
> 1, 176-92-96-218.adsl.cyta.gr, Europe/Athens,
On 05/11/2013 22:28, Nick the Gr33k wrote:
Στις 6/11/2013 12:06 πμ, ο/η John Gordon έγραψε:
In Nick the Gr33k
writes:
# fetch those columns that act as lists but are stored as
strings
cur.execute('''SELECT refs, visits, downloads FROM visitors
WHERE
counterID = %s and host =
Στις 6/11/2013 12:15 πμ, ο/η Piet van Oostrum έγραψε:
Nick the Gr33k writes:
IAM STRUGGLING WITH IT 2 DAYS NOW AND I CANNOT GET IT TO WORK.
ALL I WANT IT TO DO IS JUST
1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS
2. CONVERT LONG STRINGS TO LISTS
3. ADD SOME CURRENT VALUES TO THOSE L
Στις 6/11/2013 12:06 πμ, ο/η John Gordon έγραψε:
In Nick the Gr33k
writes:
# fetch those columns that act as lists but are stored as
strings
cur.execute('''SELECT refs, visits, downloads FROM visitors
WHERE
counterID = %s and host = %s''', (cID, host) )
Nick the Gr33k writes:
>
> IAM STRUGGLING WITH IT 2 DAYS NOW AND I CANNOT GET IT TO WORK.
>
> ALL I WANT IT TO DO IS JUST
>
> 1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS
> 2. CONVERT LONG STRINGS TO LISTS
> 3. ADD SOME CURRENT VALUES TO THOSE LISTS
> 4. CONVERT FROM LISTS TO LONG STRINGS
In Nick the Gr33k
writes:
> # fetch those columns that act as lists but are stored as
> strings
> cur.execute('''SELECT refs, visits, downloads FROM visitors
> WHERE
> counterID = %s and host = %s''', (cID, host) )
> data = cur.fetchone()
>
On Wed, Nov 6, 2013 at 8:17 AM, Mark Lawrence wrote:
> I've taken a different approach. I've put the contract out to tender and
> hereby give you the winners
> http://www.mudefordwoodcommunitycentre.co.uk/playgroup-and-tiny-tots/
Sounds good! But I don't see a list of their technologies - do they
On 05/11/2013 21:17, Mark Lawrence wrote:
On 05/11/2013 20:19, John Gordon wrote:
In Nick the Gr33k
writes:
IAM STRUGGLING WITH IT 2 DAYS NOW AND I CANNOT GET IT TO WORK.
ALL I WANT IT TO DO IS JUST
1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS
2. CONVERT LONG STRINGS TO LISTS
3
Στις 5/11/2013 10:19 μμ, ο/η John Gordon έγραψε:
In Nick the Gr33k
writes:
IAM STRUGGLING WITH IT 2 DAYS NOW AND I CANNOT GET IT TO WORK.
ALL I WANT IT TO DO IS JUST
1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS
2. CONVERT LONG STRINGS TO LISTS
3. ADD SOME CURRENT VALUES TO THOS
On 05/11/2013 20:19, John Gordon wrote:
In Nick the Gr33k
writes:
IAM STRUGGLING WITH IT 2 DAYS NOW AND I CANNOT GET IT TO WORK.
ALL I WANT IT TO DO IS JUST
1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS
2. CONVERT LONG STRINGS TO LISTS
3. ADD SOME CURRENT VALUES TO THOSE LISTS
4
In Nick the Gr33k
writes:
> IAM STRUGGLING WITH IT 2 DAYS NOW AND I CANNOT GET IT TO WORK.
> ALL I WANT IT TO DO IS JUST
> 1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS
> 2. CONVERT LONG STRINGS TO LISTS
> 3. ADD SOME CURRENT VALUES TO THOSE LISTS
> 4. CONVERT FROM LISTS TO LONG STRING
On Tue, 05 Nov 2013 20:09:42 +0200, Nick the Gr33k wrote:
> Denis, i have already provided my code trying to do what i need and i
> need some commendation on how to make it work.
Nick, you're obviously trying to code way above your abilities.
If you want me to write your code, you will have to p
On Tue, Nov 5, 2013 at 1:11 PM, Tobiah wrote:
> All this problem arises because MySQL's hasn't got a datatype able to store
> an array of elements, a list.
>
> Um, yes it does. It's called a table.
> --
> https://mail.python.org/mailman/listinfo/python-list
Perhaps we are splitting hairs, but a
All this problem arises because MySQL's hasn't got a datatype able to store an
array of elements, a list.
Um, yes it does. It's called a table.
--
https://mail.python.org/mailman/listinfo/python-list
Στις 5/11/2013 8:02 μμ, ο/η Denis McMahon έγραψε:
On Tue, 05 Nov 2013 19:06:25 +0200, Nick the Gr33k wrote:
IAM STRUGGLING WITH IT 2 DAYS NOW AND I CANNOT GET IT TO WORK.
Try starting with something simple. The following is a step by step guide
to working out how you need to do this. Follow a
On Tue, 05 Nov 2013 19:06:25 +0200, Nick the Gr33k wrote:
> IAM STRUGGLING WITH IT 2 DAYS NOW AND I CANNOT GET IT TO WORK.
Try starting with something simple. The following is a step by step guide
to working out how you need to do this. Follow all the steps. Do not skip
any steps. Each stage bu
Στις 5/11/2013 7:41 μμ, ο/η Steven D'Aprano έγραψε:
On Tue, 05 Nov 2013 19:06:25 +0200, Nick the Gr33k wrote:
ALL I WANT IT TO DO IS JUST
1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS 2. CONVERT LONG
STRINGS TO LISTS
3. ADD SOME CURRENT VALUES TO THOSE LISTS 4. CONVERT FROM LISTS TO LON
Op 05-11-13 18:41, Steven D'Aprano schreef:
> On Tue, 05 Nov 2013 19:06:25 +0200, Nick the Gr33k wrote:
>
>> ALL I WANT IT TO DO IS JUST
>>
>> 1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS 2. CONVERT LONG
>> STRINGS TO LISTS
>> 3. ADD SOME CURRENT VALUES TO THOSE LISTS 4. CONVERT FROM LISTS
On Tue, 05 Nov 2013 19:06:25 +0200, Nick the Gr33k wrote:
> ALL I WANT IT TO DO IS JUST
>
> 1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS 2. CONVERT LONG
> STRINGS TO LISTS
> 3. ADD SOME CURRENT VALUES TO THOSE LISTS 4. CONVERT FROM LISTS TO LONG
> STRINGS SO I CAN STORE SUCCESSFULLY LIST
EVERYHTIGN I TRIED FAILED.
Maybe try some of the advice you have been given instead?
--
https://mail.python.org/mailman/listinfo/python-list
> =
>
> IAM STRUGGLING WITH IT 2 DAYS NOW AND I CANNOT GET IT TO WORK.
>
> ALL I WANT IT TO DO IS JUST
>
> 1. RETRIEVE 3 COLUMNS THAT CONSIST OF 3 LONG STRINGS
> 2. CONVERT LONG STRINGS TO LISTS
> 3. ADD SOME CURRENT VALUES TO THOSE LISTS
> 4. CONVERT
==
# fetch those columns that act as lists but are stored as
strings
cur.execute('''SELECT refs, visits, downloads FROM visitors WHERE
counterID = %s and host = %s''', (cID, host) )
data = cur.fetchone()
ref
On Friday, October 19, 2012 4:40:42 PM UTC+8, inshu chauhan wrote:
> in this prog I have written a code to calculate teh centre of a given 3D
> data..
>
>
>
> but i want to calculate it for every 3 points not the whole data, but
>
> instead of giving me centre for every 3 data the prog is prin
inshu chauhan wrote:
>
>but i want to calculate it for every 3 points not the whole data, but
>instead of giving me centre for every 3 data the prog is printing the
>centre 3 times...
>
>def main (data):
>j = 0
>for i in data[:3]:
>while j != 3:
> centre = CalcCentre(data)
Dont know what your code does/tries to do. Anyway some points:
On Oct 19, 1:40 pm, inshu chauhan wrote:
> in this prog I have written a code to calculate teh centre of a given 3D
> data..
>
> but i want to calculate it for every 3 points not the whole data, but
> instead of giving me centre for
in this prog I have written a code to calculate teh centre of a given 3D data..
but i want to calculate it for every 3 points not the whole data, but
instead of giving me centre for every 3 data the prog is printing the
centre 3 times...
import cv
from math import floor, sqrt, ceil
from numpy imp
Daniel Fetchinson a écrit :
Thanking you,
Ms. Vaidehi Pawar
How much do you pay?
How much do you ask for
cheers
Ms. Vaidehi
I was just kidding. But if you seriously need people to do this kind
of job it's better to post the amount you are willing to pay otherwise
nobody will take it
>
> I find it impossible to take anyone asking others to do their school
> work for them seriously no matter how or what they are willing to pay.
>
Exactly, and writing the subject of the post in all capitals doesn't help
either...
Almar
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Sep 11, 2008 at 12:02 PM, Daniel Fetchinson
<[EMAIL PROTECTED]> wrote:
>
>
>>> Thanking you,
>>>
>>> Ms. Vaidehi Pawar
>>
>> How much do you pay?
>>
>>> How much do you ask for
>>>
>>> cheers
>>> Ms. Vaidehi
>
> I was just kidding. But if you seriously need people to do this kind
> of
>> Thanking you,
>>
>> Ms. Vaidehi Pawar
>
> How much do you pay?
>
>> How much do you ask for
>>
>> cheers
>> Ms. Vaidehi
I was just kidding. But if you seriously need people to do this kind
of job it's better to post the amount you are willing to pay otherwise
nobody will take it seriously
On Sep 10, 3:33 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]>
wrote:
> > I know I'm to late to ask you for helpbut please help me out..I
> > am really new to unix and dont know how to finish this assignment on
> > time.proff. said he will be using MOSS to detect whether I
> > downloaded t
> I know I'm to late to ask you for helpbut please help me out..I
> am really new to unix and dont know how to finish this assignment on
> time.proff. said he will be using MOSS to detect whether I
> downloaded the code..please help me..
>
> email me : [EMAIL PROTECTED]
>
> Assignment 1
I know I'm to late to ask you for helpbut please help me out..I
am really new to unix and dont know how to finish this assignment on
time.proff. said he will be using MOSS to detect whether I
downloaded the code..please help me..
email me : [EMAIL PROTECTED]
Assignment 1
Processes, In
On Thu, 01 Feb 2007 08:53:55 -0800, Ravi Teja wrote:
>> > > It search a text inside that hex value.
>> > > It works perfecly on a txt file but if I open a binary file (.exe,.bin
>> > > ecc...) with the same value it wont work, why?
>> > > Please help!
>>
>> > Because the pattern isn't in the file,
> > > It search a text inside that hex value.
> > > It works perfecly on a txt file but if I open a binary file (.exe,.bin
> > > ecc...) with the same value it wont work, why?
> > > Please help!
>
> > Because the pattern isn't in the file, perhaps.
>
> This pattern IS in the file (I made it and I d
On Feb 1, 4:21 am, "TOXiC" <[EMAIL PROTECTED]> wrote:
> Hi all, I've this code:
>
> regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*)
> (\xC6\x44\x24)",re.IGNORECASE)
> file = open(fileName, "rb")
> for line in file:
> if (match):
> print line
> file.close()
Peter Otten ha scritto:
> TOXiC wrote:
>
> > Hi all, I've this code:
>
> No you don't.
>
!
> > regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*)
> > (\xC6\x44\x24)",re.IGNORECASE)
> > file = open(fileName, "rb")
> > for line in file:
> > if (match):
> >
TOXiC wrote:
> Hi all, I've this code:
No you don't.
> regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*)
> (\xC6\x44\x24)",re.IGNORECASE)
> file = open(fileName, "rb")
> for line in file:
> if (match):
> print line
> file.close()
>
> It search a text in
Hi all, I've this code:
regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*)
(\xC6\x44\x24)",re.IGNORECASE)
file = open(fileName, "rb")
for line in file:
if (match):
print line
file.close()
It search a text inside that hex value.
It works perfecly on a txt fi
62 matches
Mail list logo