Re: Case-insensitive string equality

2017-09-01 Thread Chris Angelico
On Sat, Sep 2, 2017 at 12:21 PM, Steve D'Aprano wrote: > On Fri, 1 Sep 2017 01:29 am, Tim Chase wrote: > >> On 2017-08-31 07:10, Steven D'Aprano wrote: >>> So I'd like to propose some additions to 3.7 or 3.8. >> >> Adding my "yes, a case-insensitive equality-check would be useful" >> with the foll

Re: Case-insensitive string equality

2017-09-01 Thread Steve D'Aprano
On Fri, 1 Sep 2017 01:29 am, Tim Chase wrote: > On 2017-08-31 07:10, Steven D'Aprano wrote: >> So I'd like to propose some additions to 3.7 or 3.8. > > Adding my "yes, a case-insensitive equality-check would be useful" > with the following concerns: > > I'd want to have an optional parameter to

Re: Case-insensitive string equality

2017-09-01 Thread Chris Angelico
On Sat, Sep 2, 2017 at 10:31 AM, Steve D'Aprano wrote: > On Sat, 2 Sep 2017 01:41 am, Chris Angelico wrote: > >> Aside from lower(), which returns the string unchanged, the case >> conversion rules say that this contains two letters. > > Do you have a reference to that? > > I mean, where in the Un

Re: Case-insensitive string equality

2017-09-01 Thread Steve D'Aprano
On Sat, 2 Sep 2017 01:41 am, Chris Angelico wrote: > Aside from lower(), which returns the string unchanged, the case > conversion rules say that this contains two letters. Do you have a reference to that? I mean, where in the Unicode case conversion rules is that stated? You cannot take the beh

Re: Case-insensitive string equality

2017-09-01 Thread Chris Angelico
On Sat, Sep 2, 2017 at 10:09 AM, Steve D'Aprano wrote: > The question wasn't what "\N{LATIN SMALL LIGATURE FI}".upper() would find, > but "\N{LATIN SMALL LIGATURE FI}". > > Nor did they ask about > > "\N{LATIN SMALL LIGATURE FI}".replace("\N{LATIN SMALL LIGATURE > FI}", "Surprise!") > >> So what's

Re: Python string replace the values

2017-09-01 Thread Steve D'Aprano
On Sat, 2 Sep 2017 03:13 am, Ganesh Pal wrote: > Example : > > "a" and "1" => a0001 > > "a" and "aa" => c00aa Why does the leading 'a' change to a 'c'? Is that a mistake? I'll assume its a typo. You want string slicing. base = 'a' extra = 'ab' print( base[:-len(extra)] + extra

Re: Case-insensitive string equality

2017-09-01 Thread Steve D'Aprano
On Sat, 2 Sep 2017 01:41 am, Chris Angelico wrote: > On Fri, Sep 1, 2017 at 11:22 PM, Steve D'Aprano > wrote: >> On Fri, 1 Sep 2017 09:53 am, MRAB wrote: >> >>> What would you expect the result would be for: >>> >>> "\N{LATIN SMALL LIGATURE FI}".case_insensitive_find("F") >>> >>> "\N{LA

Re: If you are running 32-bit 3.6 on Windows, please test this

2017-09-01 Thread eryk sun
On Fri, Sep 1, 2017 at 2:24 AM, Pavol Lisy wrote: > > I was trying to call sqrt using ctypes from msvcrt but I am not succesful: > > import ctypes > msc = ctypes.windll.msvcrt msvcrt.dll is private to Windows components. It's not intended for applications. See my previous post in this thread for

Re: If you are running 32-bit 3.6 on Windows, please test this

2017-09-01 Thread eryk sun
On Fri, Sep 1, 2017 at 3:23 AM, Peter Otten <__pete...@web.de> wrote: > > I think you have to specify the types yourself: > import ctypes libm = ctypes.cdll.LoadLibrary("libm.so") libm.sqrt(42) > 0 libm.sqrt.argtypes = [ctypes.c_double] libm.sqrt.restype = ctypes.c_double >

Re: virtualenv doesn't see my compiled tensorflow

2017-09-01 Thread ross
Solution: remember to run the 'activate' script: % source ~/tf_compile/tensorflow/bin/activate On Friday, September 1, 2017 at 2:39:33 PM UTC-7, ro...@cgl.ucsf.edu wrote: > With the prebuilt version of tensorflow, I did: > >virtualenv --system-site-packages ~/tensorflow > > and someho

virtualenv doesn't see my compiled tensorflow

2017-09-01 Thread ross
With the prebuilt version of tensorflow, I did: virtualenv --system-site-packages ~/tensorflow and somehow got it working with keras. Now I've compiled tensorflow in another shell/directory, where to start with I did: virtualenv --system-site-packages . and I got it running with keras

Re: Solutions Manual Test Bank for McGraw-Hill's Taxation of Business Entities 2018 Edition 9th Edition by Spilker

2017-09-01 Thread landytips90
On Saturday, July 1, 2017 at 6:34:07 PM UTC-4, Test Banks wrote: > Greetings, > > You can get Solution Manuals and Test Bank for " McGraw-Hill's Taxation of > Business Entities 2018 Edition 9th Edition by Brian Spilker and Benjamin > Ayers and John Barrick and Edmund Outslay and John Robinson a

Re: I am not able to run Python in Powershell

2017-09-01 Thread MRAB
On 2017-09-01 15:38, The Cat Gamer wrote: fter I installed Python I try to open it in Powershell, by typing python/python.exe. It gives me an error: python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or

I am not able to run Python in Powershell

2017-09-01 Thread The Cat Gamer
fter I installed Python I try to open it in Powershell, by typing python/python.exe. It gives me an error: python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the pat

Re: Python string replace the values

2017-09-01 Thread Ganesh Pal
>Note you should think VERY CAREFULLY about any user input like this. What are you going to do the user gives you too many digits, too few digits, non-digits Thanks the solution i.e using zfill() looks simple :) , we have a check that will take care of user input than's for noticing that On Fri,

Re: Python string replace the values

2017-09-01 Thread Ganesh Pal
> (I assume that in your example "a" and "aa" => c00aa, that really should have been a00aa) Yes , thanks for noticing. On Fri, Sep 1, 2017 at 11:18 PM, Irv Kalb wrote: > > > On Sep 1, 2017, at 10:13 AM, Ganesh Pal wrote: > > > > In the fixed length string i.e "a",last 4 bits i.e "00

Re: Python string replace the values

2017-09-01 Thread Irv Kalb
> On Sep 1, 2017, at 10:13 AM, Ganesh Pal wrote: > > In the fixed length string i.e "a",last 4 bits i.e "" should be > replaced by the user provided value ( the value is between 0001 + f f f f ) > . I intend to form final_string using a fixed_string and an user provided > user_string >

Re: Python string replace the values

2017-09-01 Thread Rhodri James
On 01/09/17 18:13, Ganesh Pal wrote: "a" + "1"===> expected was a0001 'a1' Why would you expect that? Concatenation means "joining together", so >>> "foo" + "bar" 'foobar' No other mangling of either of your original strings is going to happen; there is no magic going on here.

Re: Python string replace the values

2017-09-01 Thread MRAB
On 2017-09-01 18:13, Ganesh Pal wrote: In the fixed length string i.e "a",last 4 bits i.e "" should be replaced by the user provided value ( the value is between 0001 + f f f f ) . I intend to form final_string using a fixed_string and an user provided user_string Example: fixed_st

Python string replace the values

2017-09-01 Thread Ganesh Pal
In the fixed length string i.e "a",last 4 bits i.e "" should be replaced by the user provided value ( the value is between 0001 + f f f f ) . I intend to form final_string using a fixed_string and an user provided user_string Example: fixed_string = "a" user_string ='1' final str

Re: python logic

2017-09-01 Thread SS
On Friday, September 1, 2017 at 9:32:16 AM UTC-4, SS wrote: > Check out the following simple code: > > #!/bin/python > > print "1 - echo 1" > print "2 - echo 2" > > answer = input("Enter your choice - ") > > if answer == 1: > print "1" > elif answer == 2: > print "2" > else: > print "Inva

Re: python logic

2017-09-01 Thread Rhodri James
On 01/09/17 14:30, SS wrote: Check out the following simple code: #!/bin/python print "1 - echo 1" print "2 - echo 2" answer = input("Enter your choice - ") if answer == 1: print "1" elif answer == 2: print "2" else: print "Invalid choice!" The else statement noted above works fine

Re: Case-insensitive string equality

2017-09-01 Thread Chris Angelico
On Fri, Sep 1, 2017 at 11:22 PM, Steve D'Aprano wrote: > On Fri, 1 Sep 2017 09:53 am, MRAB wrote: > >> What would you expect the result would be for: >> >> "\N{LATIN SMALL LIGATURE FI}".case_insensitive_find("F") >> >> "\N{LATIN SMALL LIGATURE FI}".case_insensitive_find("I) > > That's ea

Select data in N-Triples

2017-09-01 Thread David Shi via Python-list
in a N-Triples file, there are a lot lines like the following: "Baginton E04009817"@en .

Re: python logic

2017-09-01 Thread Steve D'Aprano
On Fri, 1 Sep 2017 11:30 pm, SS wrote: > Check out the following simple code: [...] Did you read the documentation for the `input` function? In Python 2, `input` should be avoided, because it evaluates whatever the user types. Watch this: py> answer = input('type a number ') type a number 'abcd

Re: python logic

2017-09-01 Thread eth0
Era el Fri, 1 Sep 2017 06:30:43 -0700 (PDT) en comp.lang.python, cuando de repente SS dijo lo siguiente acerca de python logic: > Check out the following simple code: > > #!/bin/python > > print "1 - echo 1" > print "2 - echo 2" > > answer = input("Enter your choice - ") > > if answer ==

python logic

2017-09-01 Thread SS
Check out the following simple code: #!/bin/python print "1 - echo 1" print "2 - echo 2" answer = input("Enter your choice - ") if answer == 1: print "1" elif answer == 2: print "2" else: print "Invalid choice!" The else statement noted above works fine for numeric values other then 1 o

Re: Case-insensitive string equality

2017-09-01 Thread Steve D'Aprano
On Thu, 31 Aug 2017 08:15 pm, Rhodri James wrote: > I'd quibble about the name and the implementation (length is not > preserved under casefolding), Yes, I'd forgotten about that. > but I'd go for this. The number of times > I've written something like this in different languages... [...] >

Re: Case-insensitive string equality

2017-09-01 Thread Steve D'Aprano
On Fri, 1 Sep 2017 09:53 am, MRAB wrote: > What would you expect the result would be for: > > "\N{LATIN SMALL LIGATURE FI}".case_insensitive_find("F") > > "\N{LATIN SMALL LIGATURE FI}".case_insensitive_find("I) That's easy. -1 in both cases, since neither "F" nor "I" is found in eit

how to update mongo using a dataframe for multiple documents

2017-09-01 Thread Daiyue Weng
Hi, I am trying to batch update mongo using a DataFrame, df_dict = df[['id', 'name']].to_dict(orient='records') [{'name': 'vendor1', 'id': '1'}, {'name': 'vendor2', 'id': '2'}, {'name': 'vendor3', 'id': '3'}, {'name': 'vendor4', 'id': '4'}, {'name': 'vendor5', 'id': '5'}, {'name': 'vendor6',

Solutions Manual Test Bank for College Physics 11th Edition by Serway

2017-09-01 Thread estavilloraymart
Can i buy youre solutions manual ? -- https://mail.python.org/mailman/listinfo/python-list

rdflib, N-Triples and Pandas

2017-09-01 Thread David Shi via Python-list
How best to use rdflib to parse N-Triples files and turn them into Pandas tables? Looking forward to hearing from you. Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: If you are running 32-bit 3.6 on Windows, please test this

2017-09-01 Thread Peter Otten
Pavol Lisy wrote: > On 8/31/17, 20/20 Lab wrote: >> >> >> On 08/31/2017 01:53 AM, Pavol Lisy wrote: > [...] >> Valid point, fired up a windows 10 machine and worked as well. >> >> Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit >> (Intel)] on win32 >> Type "copyright", "cre

Re: If you are running 32-bit 3.6 on Windows, please test this

2017-09-01 Thread Pavol Lisy
On 8/31/17, 20/20 Lab wrote: > > > On 08/31/2017 01:53 AM, Pavol Lisy wrote: [...] > Valid point, fired up a windows 10 machine and worked as well. > > Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more i