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', 'We
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
&
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_na
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, c
On Mar 23, 1:48 pm, 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'
&
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 = "
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
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
escapin
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.
On Thu, 05 Feb 2009 18:04:35 -, 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
where:
a = 20 / len(c)
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
exp
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()
>
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 =
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
> 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
em 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 myFieldName =
> 34) This fails complaining that the wrong number of parameters are
> present.
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 results.
> Therefore I have to con
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
18 matches
Mail list logo