On 9/22/17, Peter Otten <__pete...@web.de> wrote:
> Exposito, Pedro (RIS-MDW) wrote:
>
>> This code does a "where" clause on a panda data frame...
>>
>> Code:
>> import pandas as pd;
>> col_names = ['Name', 'Age', 'Weight', "Education&qu
Exposito, Pedro (RIS-MDW) wrote:
> This code does a "where" clause on a panda data frame...
>
> Code:
> import pandas as pd;
> col_names = ['Name', 'Age', 'Weight', "Education"];
> # create panda dataframe
> x = pd.read_csv('test.dat'
This code does a "where" clause on a panda data frame...
Code:
import pandas as pd;
col_names = ['Name', 'Age', 'Weight', "Education"];
# create panda dataframe
x = pd.read_csv('test.dat', sep='|', header=None, names = col_names);
# apply "where" co
Hi,
as you can see below I have some optional parameter for my query (mf,
age). They are in WHERE clause only if not empty.
In this function they are not escaped as, for example, 'search'
parameter, cause I can't pass them to execute function, which does
escaping automatically.
I could write
someone wrote:
Hi,
as you can see below I have some optional parameter for my query (mf,
age). They are in WHERE clause only if not empty.
In this function they are not escaped as, for example, 'search'
parameter, cause I can't pass them to execute function, which does
escaping automatically
note that your version is open to sql injection attacks, while mrab's
reply isn't. andrew
someone wrote:
if mf:
mf = AND mf = %s % mf
if age:
age = AND age = %s % age
--
http://mail.python.org/mailman/listinfo/python-list
ah, sorry, from title i guess you were aware of this. andrew
andrew cooke wrote:
note that your version is open to sql injection attacks, while mrab's
reply isn't. andrew
someone wrote:
if mf:
mf = AND mf = %s % mf
if age:
age = AND age = %s
On Mar 23, 1:48 pm, MRAB goo...@mrabarnett.plus.com wrote:
someone wrote:
Hi,
as you can see below I have some optional parameter for my query (mf,
age). They are in WHERE clause only if not empty.
In this function they are not escaped as, for example, 'search'
parameter, cause I can't
MRAB wrote:
someone wrote:
Hi,
as you can see below I have some optional parameter for my query (mf,
age). They are in WHERE clause only if not empty.
In this function they are not escaped as, for example, 'search'
parameter, cause I can't pass them to execute function, which does
escaping
This comes after a small discussion in another Python newsgroup.
Haskell supports a where clause, that's syntactic sugar that allows
you to define things like this:
p = a / b
where
a = 20 / len(c)
b = foo(d)
That means:
a = 20 / len(c)
b = foo(d)
p = a / b
I don't know how much good
On Thu, 2009-02-05 at 10:04 -0800, bearophileh...@lycos.com wrote:
This comes after a small discussion in another Python newsgroup.
Haskell supports a where clause, that's syntactic sugar that allows
you to define things like this:
p = a / b
where
a = 20 / len(c)
b = foo(d
Albert Hopkins:
One could imagine this getting out of hand e.g.
Yes, any syntax can be abused (your example isn't abusive enough).
a = 20 / len(c)
where
c = p / b
try:
b = foo(d)
where
d = bar()
bearophileh...@lycos.com writes:
Note that where may also be designed to create a new scope (as in
Haskell, I think), that's why I have inlined the bar and p/b.
In Haskell, where is only allowed at the outermost level of a
function definition (including a nested one), not in an arbitrary
On Thu, 05 Feb 2009 18:04:35 -, bearophileh...@lycos.com wrote:
p = a / b
where
a = 20 / len(c)
b = foo(d)
You'd want to do it with paired keywords, in the manner of try/except,
to avoid utterly breaking Python's syntax conventions. Perhaps
something like this:
do:
p = a / b
I should point out that I don't do DAO (or ADO) -- and if I had to
code Python to access JET, I'd probably hijack a copy of mxODBC in order
to get a sane SQL interface.
I have successfully used the dejavu object-relational mapper (http://
projects.amor.org/docs/dejavu/1.5.0RC1/) to
SELECT * FROM TableName), but have not been able to figure out how to add
a WHERE clause to that (e.g., SELECT * FROM TableName WHERE myFieldName =
34) This fails complaining that the wrong number of parameters are
present.
I haved tried DAO36 and I have tried the ADO version with the same
Hi all,
I am attempting to use Access97 as the database to hold the results of a
python script. I seem to be able to make simple SELECT clauses work (like
SELECT * FROM TableName), but have not been able to figure out how to add a
WHERE clause to that (e.g., SELECT * FROM TableName WHERE
On Jun 9, 10:17 am, v.davis2 [EMAIL PROTECTED] wrote:
Hi all,
I am attempting to use Access97 as the database to hold the results of a
python script. I seem to be able to make simple SELECT clauses work (like
SELECT * FROM TableName), but have not been able to figure out how to add a
WHERE
18 matches
Mail list logo