Re: best way to share an instance of a class among modules?

2013-02-06 Thread c
On Feb 6, 7:03 pm, Michael Torrie wrote: > On 02/06/2013 03:41 PM, CM wrote: > > > Thank you.  But, I'm sorry, I'm not following this enough to get it to > > work.  Shouldn't it be a little more like this: > > No, not exactly. > > > > > # in utilities module > > shared_cursor =  DatabaseAccess_ins

Re: Is Python what I need?

2009-08-23 Thread c
> I'm interested in developing computer based, interactive programs That is so open-ended it could mean anything. If you give a much more specified idea of what you are imagining creating, people could be helpful. > for students in a special school who have an aversion to pen and paper. Aversi

python 3.3 urllib.request

2012-12-07 Thread Steeve C
hello, I have a python3 script with urllib.request which have a strange behavior, here is the script : + #!/usr/bin/env python3 # -*- coding: utf-8 -*- import urllib.request import sys, time url = 'http://google.co

numpy array operation

2013-01-29 Thread C. Ng
Is there a numpy operation that does the following to the array? 1 2 ==> 4 3 3 4 2 1 Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

h5py.File() gives error message

2017-10-24 Thread C W
Dear list, The following Python code gives an error message # Python code starts here: import numpy as np import h5py train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r") # Python code ends The error message: train_dataset = h5py.File('train_catvnoncat.h5', "r") Traceback (most recen

Re: h5py.File() gives error message

2017-10-25 Thread C W
Oh, I was running a debug file, that's why the path is different. The file is here, https://www.dropbox.com/s/6jx4rzyg9xwl95m/train_catvnoncat.h5?dl=0 Is anyone able to get it working? Thank you! On Tue, Oct 24, 2017 at 10:37 PM, Dennis Lee Bieber wrote: > On Tue, 24 Oct 2017 18:02:26 -0700, R

Re: h5py.File() gives error message

2017-10-25 Thread C W
wow, thanks so much! I don't know how you figured that it's HTML, but that's awesome! Mike On Wed, Oct 25, 2017 at 5:20 AM, Peter Otten <__pete...@web.de> wrote: > C W wrote: > > > Oh, I was running a debug file, that's why the path is differen

I have anaconda, but Pycharm can't find it

2017-11-26 Thread C W
Hello all, I am a first time PyCharm user. I have Python 3 and Anaconda installed. They work together on Sublime Text, but not on Pycharm. Pycharm tells me it cannot find modules numpy, matplotlib, etc. What should I do? I tried to set the interpreter environment, and a few other options, none s

Why does Jupyter Notebook searches files in folders, but PyCharm and Sublime Text does not?

2017-12-14 Thread C W
Hi all, I am confused why Jupyter Notebook searches files in subfolder, but PyCharm and Sublime Text 3 does not. Is there a rule? For example, I have a module or file called lr_utils.py in the current folder. If I run the following line in Jupyter, it's fine. > import lr_utils But in PyCharm, I

PEP about recommended project folder layout

2022-07-26 Thread c . buhtz
Hello, I am not sure if I looked into the correct sources. I was looking in "PEP 609 – Python Packaging Authority (PyPA) Governance" [1] and the "PyPA specifications" [2]. My question in short: Is there an official document (e.g. a PEP) about a recommended layout for project folders. Looki

venv and packages with entry points

2022-09-06 Thread c . buhtz
Hello, I try to get it onto my head how virtual environments (via venv) works when I have packages with "entry points". I can define such entry points in the setup.cfg like this (full example [1]): [options.entry_points] console_scripts = hyperorg = hyperorg.__main__:main When I instal

Re: Which architectures to support in a CI like Travis?

2022-09-19 Thread c . buhtz
Dear Mats, thanks for the reply. Am 19.09.2022 16:10 schrieb Mats Wichmann: Kind of unrelated to the actual question, but if you start doing anything serious under Travis you'll run out of free minutes rather quickly. My project had to just give up on it after they changed their licensing mode

How to get the current set LOG_MASK in Python's syslog module?

2022-09-22 Thread c . buhtz
X-Post: https://stackoverflow.com/q/73814924/4865723 Hello, I'm aware that there is a `logging` package that is more _modern_ then [`syslog`](https://docs.python.org/3/library/syslog.html). But I have old code here to deal with that does use `syslog`. So that question is specific to `syslog`

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-18 Thread c . buhtz
Dear Gerard, thank you for your reply. Am 18.12.2022 19:45 schrieb Weatherby,Gerard: "sudo python3 -m pip install -e ." You’ve already started down a problematic road. I recommend installing root level Python packages through your system package manager. (apt for debian, or whatever RedHat is u

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-18 Thread c . buhtz
Dear Chris, thank you for your reply. Am 18.12.2022 20:27 schrieb Chris Angelico: Does it have to be in path? Can't you say /usr/local/bin/entrypointname? Not sure what constitutes an elegant solution here. I asked that myself. My current solution do determine the full path of the entrypoint

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-18 Thread c . buhtz
Am 18.12.2022 22:37 schrieb Mats Wichmann: the which command uses your PATH, so I'm not sure you're buying anything new there I'm using which before entering pkexec. ;) I'll show a demonstrator project later. -- https://mail.python.org/mailman/listinfo/python-list

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-18 Thread c . buhtz
Dear Barry, thanks for reply and asking back. Am 18.12.2022 22:33 schrieb Barry: Why are asking on this list and discuss.python.org? To be exact I'm asking in the "Packaging" section of "discuss.python.org". To my knowledge that section is the official channel of "pypa/pip" project pointed t

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-19 Thread c . buhtz
Dear Chris, thanks for asking back and my apologize for being to broad in my way of asking (in a foreign language). Am 19.12.2022 07:40 schrieb Chris Angelico: Hmm, then I'm not sure what you're *losing* here. The problem, as I understand it, is that the scripts are getting installed into /usr

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread c . buhtz
Am 03.01.2023 17:51 schrieb r...@zedat.fu-berlin.de: logging.getLogger().addHandler( logging.StreamHandler( sys.stdout )) But I don't want to make all log levels go to stdout. Just DEBUG and INFO. But this would be a workaround. The main question here is why does Python deciecded to make all

Re: subprocess equivalent for "os.execvp()"?

2023-01-09 Thread c . buhtz
Dear Eryk, Am 08.01.2023 17:22 schrieb Eryk Sun: Avoid using any of the `os.exec*` functions on Windows. There's no support for replacing a Windows process image, so the `exec*()` functions simply spawn a child process and terminate the current one. Thanks for bringing this up. On Python for

[pygettext] --package-name and --package-version unknown

2023-05-04 Thread c . buhtz
Hello, am I right to assume that "pygettext" is part of the official Python3 "package"? So it is OK to aks here? I do use pygettext to handle po and pot files. In the manpage I'm not able to find help about this. I would like to modify the header that pygettext does create in each po-file.

Re: [pygettext] --package-name and --package-version unknown

2023-05-05 Thread c . buhtz
Thanks for the answer. Am 05.05.2023 03:24 schrieb aapost: pygettext is deprecated since xgettext supports python now, so using xgettext is recommended. If this is the official case then it should be mentioned in the python docs. The 3.11 docs still tell about pygettext and xgettext and don't

How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
Hello everyone, I'm a long time Matlab and R user working on data science. How do you troubleshooting/debugging in Python? I ran into this impossible situation to debug: class person: def __init__(self, id, created_at, name, attend_date, distance): """Create a new `person`. """ self._id = id self

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
Thanks for your replies. My apologies for the poor indent. I'm rewriting the code below. class NEODatabase: def __init__(self, id, created_at, name, attend_date, distance): self._id = id self.created_at = created_at self.name = name self.attend_date = attend_date self.distance = distance @classme

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
27;created_at'], KeyError: 'created_at' Thank you very much! On Wed, Jan 27, 2021 at 12:10 AM Michael Torrie wrote: > On 1/26/21 8:37 PM, C W wrote: > > I have a naive question. How do I use traceback or trace the stack? In > > particular, I'm using VS Cod

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
Hi Cameron, Yes, you are correct in all above. There's a mistake in my copy paste. Thanks for pointing that out! On Wed, Jan 27, 2021 at 12:58 AM Cameron Simpson wrote: > On 27Jan2021 00:19, C W wrote: > >Here's the code again, class should be called PERSONDatabase, >

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
ts on here are approaching and debugging this. Bonus if no debugger or breakpoint. Just the good ol' run the function and evaluate/print output for problems. Thanks so much, Mike On Wed, Jan 27, 2021 at 10:53 AM Michael Torrie wrote: > On 1/26/21 10:19 PM, C W wrote: > > Tr

Re: IDE tools to debug in Python?

2021-01-27 Thread C W
I'm not expert in Python, but I sure tried many IDEs to kick off Python programming. I started with PyCharm, but I had a problem with it constantly scanning the background, even after I turned that feature off. My favorite (I'm using now) is VS Code with Python extension, it's very light. Recentl

Re: IDE tools to debug in Python?

2021-01-27 Thread C W
I don't know exactly, but it shows as inspection on the bottom left corner. I believe it's indexing in the background. On Wed, Jan 27, 2021 at 3:25 PM Grant Edwards wrote: > On 2021-01-27, C W wrote: > > I'm not expert in Python, but I sure tried many IDEs to kick of

Re: IDE tools to debug in Python?

2021-01-27 Thread C W
I meant bottom right corner, not left. opps! On Wed, Jan 27, 2021 at 3:36 PM C W wrote: > I don't know exactly, but it shows as inspection on the bottom left corner. > > I believe it's indexing in the background. > > On Wed, Jan 27, 2021 at 3:25 PM Grant Edwards >

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
Great tutorial Irv, very simple with if-else example, gets the point across. My main takeaway from the discussion so far is that: you can't troubleshoot Python without some kind of breakpoint or debugger. I suppose I can't take the functional programming debugger style like C, Matlab,

Is there a way to subtract 3 from every digit of a number?

2021-02-20 Thread C W
Hello everyone, I'm curious if there is a way take number and back each digit by 3 ? 2342 becomes 9019 8475 becomes 5142 5873 becomes 2540 The tricky part is that 2 becomes 9, not -1. Here's my toy example and what I attempted, > test_series = pd.Series(list(['2342', '8475', '5873'])) > test_se

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
Thanks so much everyone, I appreciate it! Ming, your solution is awesome. More importantly, very clear explanations on how and why. So, I appreciate that. Thanks again, cheers! Mike On Sun, Feb 21, 2021 at 12:08 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2021-02-20 at 20:49:15 -0800,

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
y(), df['col_1'].apply(lambda:a int("".join(map(lambda x: str((int(x)-3)%10) ,list(str(a)) Thanks! On Sun, Feb 21, 2021 at 9:12 AM C W wrote: > Thanks so much everyone, I appreciate it! > > Ming, your solution is awesome. More importantly, very clear explanations &

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
I got it to work! I defined a separate function, and put it into df['col_1'].apply(). Not the most elegant, but it worked. I'm also curious how people on this mailing list would do it. Cheers! On Sun, Feb 21, 2021 at 9:21 AM C W wrote: > I do want to follow up, if I may.

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
Hey Avi, I am a long time R user now using Python. So, this is my attempt to master the language. The problem for me is that I often have an idea about how things are done in R, but not sure to what functions are available in Python. I hope that clears up some confusion. Cheer! On Sun, Feb 21,

Fwd: Error message

2016-11-10 Thread Keenan C
To whom this may concern, I am continuously receiving this error after the installation of Python 3.5.2. The purpose of using this program is for a class I am currently enrolled in at a University. (I am running Windows 7 Home Premium 64-bit paired with an i3-2100 processor and 6 gb of ram. I d

How to properly retrieve data using requests + bs4 from multiple pages in a site?

2016-12-01 Thread Juan C.
I'm a student and my university uses Moodle as their learning management system (LMS). They don't have Moodle Web Services enabled and won't be enabling it anytime soon, at least for students. The university programs have the following structure, for example: 1. Bachelor's Degree in Computer Scien

Re: How to properly retrieve data using requests + bs4 from multiple pages in a site?

2016-12-03 Thread Juan C.
On Thu, Dec 1, 2016 at 10:07 PM, Juan C. wrote: > It works, but it has a big issue: it gets all data from all units/courses/assignments at the same time, and this isn't very useful as I don't care about data from units from 1-2 years ago. How can I change the logic so it just gets th

The right way to 'call' a class attribute inside the same class

2016-12-11 Thread Juan C.
I'm watching a Python course and was presented a topic regarding classes. One of the examples were: box.py class Box: serial = 100 def __init__(self, from_addr, to_addr): self.from_addr = from_addr self.to_addr = to_addr self.serial = Box.serial Box.serial

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Juan C.
On Sun, Dec 11, 2016 at 11:34 PM, Steve D'Aprano wrote: > So... in summary: > > > When *assigning* to an attribute: > > - use `self.attribute = ...` when you want an instance attribute; > > - use `Class.attribute = ...` when you want a class attribute in > the same class regardless of which sub

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Juan C.
neral consensus is that `__init__` shouldn't be called constructor as it isn't really a constructor (like Java/C# constructors). Some source: - http://stackoverflow.com/questions/4859129/python-and-python-c-api-new-versus-init - http://stackoverflow.com/questions/674304/pythons-u

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Juan C.
- http://www.diveintopython3.net/iterators.html "The __init__() method is called immediately after an instance of the class is created. It would be tempting — but technically incorrect — to call this the “constructor” of the class. It’s tempting, because it looks like a C++ constructor (by con

Re: Python constructors have particular semantics, and ‘Foo.__init__’ doesn't qualify (was: The right way to 'call' a class attribute inside the same class)

2016-12-12 Thread Juan C.
he class, the next one found in the class's Method Resolution Order will be called." - http://www.diveintopython3.net/iterators.html "The __init__() method is called immediately after an instance of the class is created. It would be tempting — but technically incorrect — to call this

Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-02 Thread Juan C.
On Mon, Jan 2, 2017 at 9:38 AM, Antonio Caminero Garcia < tonycam...@gmail.com> wrote: > The thing with the from-the-scratch full featured IDEs (Eclipse, IntelliJ, Pycharm) is that they look like a space craft dashboard and that unwarranted resources consumption and the unnecessary icons. I want my

What are your opinions on .NET Core vs Python?

2017-01-28 Thread Juan C.
As you guys might know, .NET Core is up and running, promising a "cross-platform, unified, fast, lightweight, modern and open source experience" (source: .NET Core official site). What do you guys think about it? Do you think it will be able to compete with and overcome Python in the opensource med

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Juan C.
On Sun, Jan 29, 2017 at 1:06 AM, Juan C. wrote: > > As you guys might know, .NET Core is up and running, promising a > "cross-platform, unified, fast, lightweight, modern and open source > experience" (source: .NET Core official site). What do you guys think about > it

Re: What library/package to use for parsing XML?

2017-01-30 Thread Juan C.
On Mon, Jan 30, 2017 at 3:58 PM, Chris Green wrote: > I want to parse some XML data, it's the address book data from the > linux program osmo. The file I want to parse is like this:- Just like Irmen said, use the default xml.etree.ElementTree, it's amazing and very simple to use. -- https://mai

Which part of the loop is it going through in this class frame?

2018-03-07 Thread C W
Hello, I am new to OOP. I'm a bit confused about the following code. class Clock(object): def __init__(self, time): self.time = time def print_time(self): time = '6:30' print(self.time) clock = Clock('5:30') clock.print_time() 5:30 I set time to 6:30, but it's co

Re: Which part of the loop is it going through in this class frame?

2018-03-08 Thread C W
__init__(self, time): self.time = time def print_time(self): time = '6:30' print(self.time) clock = Clock('5:30') clock.print_time() 5:30 Thank you! On Thu, Mar 8, 2018 at 6:30 AM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info>

How to fill in a dictionary with key and value from a string?

2018-03-30 Thread C W
Hello all, I want to create a dictionary. The keys are 26 lowercase letters. The values are 26 uppercase letters. The output should look like: {'a': 'A', 'b': 'B',...,'z':'Z' } I know I can use string.ascii_lowercase and string.ascii_uppercase, but how do I use it exactly? I have tried the foll

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
Thank you all for the response. What if I have myDict = {'a': 'B', 'b': 'C',...,'z':'A' }? So now, the values are shift by one position. key:abcdefghijklmnopqrstuvwxyz value: BCDEFGHIJKLMNOPQRSTUVWXYZA Can I fill in a key and its

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
A different but related question: myDict = dict(zip(string.ascii_lowercase + string.ascii_uppercase, string.ascii_lowercase + string.ascii_uppercase)) >myDict {'A': 'A', 'B': 'B', 'C': 'C',...,'w': 'w', 'x&#x

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
I am using Python 3.6. I ran the those lines and got a sorted dictionary by keys. On Sun, Apr 1, 2018 at 9:38 PM, Chris Angelico wrote: > On Mon, Apr 2, 2018 at 11:34 AM, C W wrote: > > A different but related question: > > > > myDict = dict(zip(string.ascii_lowercase + s

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
no < steve+comp.lang.pyt...@pearwood.info> wrote: > On Sun, 01 Apr 2018 20:52:35 -0400, C W wrote: > > > Thank you all for the response. > > > > What if I have myDict = {'a': 'B', 'b': 'C',...,'z':'A' }? So

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
shift])) How to debug a particular chunk of code? Everything in OOP is self.myDict, self.shift_dict. So, I must run the entire code to test. I just want to try myDict('hello', 4), shift_dict(4), like how you would do in C language. Thank you! On Sun, Apr 1, 2018 at 11:13 PM, Steven D

In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()?

2018-05-01 Thread C W
Hello everyone, In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()? To me, they are two of many summary statistics. So, why median() is different? Here's an example code, import numpy as np matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) # find the mean np.mean(ma

Re: In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()?

2018-05-01 Thread C W
tuple has tuple methods, etc. Now, the default way in numpy is to use function instead of methods? I'm confused. What happened to object-oriented programming? Thanks, -M On Tue, May 1, 2018 at 3:38 PM, Thomas Jollans wrote: > On 01/05/18 19:57, C W wrote: > > matrix.median()

Re: In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()?

2018-05-02 Thread C W
Thanks, Chris. That makes sense. The len() example is great! On Tue, May 1, 2018 at 10:37 PM, Chris Angelico wrote: > On Wed, May 2, 2018 at 12:22 PM, C W wrote: > > It's interesting how mean() can be implemented, but median() will break > > other packages. > > > &

In Pandas, can you do groupby in on two different datasets?

2018-06-09 Thread C W
Dear all, I want find the average ratings of movies by movieId. Below is ratings.head() of the dataset. > ratings.head() userId movieId rating timestamp parsed_time 0 12 3.5 1112486027 2005-04-02 23:53:47 1 1 29 3.5 1112484676 2005-04-02 23:31:16 2

What data types does matplotlib pyplot take?

2018-06-13 Thread C W
Hi everyone, I'm curious what data types pyplot takes. It seems that it can take numpy series, pandas series, and possibly pandas dataframe? How many people data types are out there? Is that true for all functions in like hist(), bar(), line(), etc? Is there an official documentation that lists t

Re: Python list vs google group

2018-06-15 Thread C W
I recently posted two questions, but never got any replies. I am still wondering if it was ever posted, or maybe the question was too trivial? I think someone would have at least shouted if it was too trivial or off-topic, right? On Fri, Jun 15, 2018 at 12:03 PM, Mark Lawrence wrote: > On 15/06

Why list.reverse() modifies the list, but name.replace() does not modify the string?

2018-09-03 Thread C W
Hello all, I am learning the basics of Python. How do I know when a method modifies the original object, when it does not. I have to exmaples: Example 1: > L = [3, 6, 1,4] > L.reverse() > L [4, 1, 6, 3] This changes the original list. Example 2: > name = "John Smith" > name.replace("J", j") > nam

Re: Why list.reverse() modifies the list, but name.replace() does not modify the string?

2018-09-03 Thread Mike C
f of Mark Lawrence Sent: Monday, September 3, 2018 2:21:36 PM To: python-list@python.org Subject: Re: Why list.reverse() modifies the list, but name.replace() does not modify the string? On 03/09/18 18:49, C W wrote: > Hello all, > > I am learning the basics of Python. How do I know

Why list.reverse() modifies the list, but name.replace() does not

2018-09-05 Thread C W
Hello all, I am learning the basics of Python. How do I know when a method modifies the original object, when it does not. I have to exmaples: Example 1: > L = [3, 6, 1,4] > L.reverse() > L [4, 1, 6, 3] This changes the original list. Example 2: > name = "John Smith" > name.replace("J", j") > nam

Re: Why list.reverse() modifies the list, but name.replace() does not

2018-09-05 Thread Mike C
Mark Lawrence Sent: Monday, September 3, 2018 2:21:36 PM To: python-list@python.org Subject: Re: Why list.reverse() modifies the list, but name.replace() does not modify the string? On 03/09/18 18:49, C W wrote: > Hello all, > > I am learning the basics of Python. How do I know when a m

Re: Overwhelmed by the Simplicity of Python. Any Recommendation?

2018-11-04 Thread Mike C
mmendation? Rhodri James wrote: ... > I completely agree. I too have come from a background in C, and still > do most of my day job in C or assembler. It took a while before I was > writing idiomatic Python, never mind efficient Python (arguably I still > don't, but as Rob says, who car

Logistic Regression Define X and Y for Prediction

2019-11-12 Thread Mike C
ure.dpi'] = 400 ​ import matplotlib.pyplotas plt ​ ​ # Importing the df​ # Importing the df​ os.chdir('c:\directory\data')# Location of data files​ df = pd.read_csv('blahblahfile.csv')​ ​ from sklearn.preprocessing import LabelEncoder​ hostip = Label

Re: Logistic Regression Define X and Y for Prediction

2019-11-14 Thread Mike C
Hi Jason, I will try it out... Nothing in the documentation tells a person. Thanks From: Python-list on behalf of Jason Friedman Sent: Wednesday, November 13, 2019 7:19 PM Cc: python-list@python.org Subject: Re: Logistic Regression Define X and Y for Predicti

Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Joydeep C
I have a Pandas dataframe like below. XY 0 1234567890 1 54321N/A 2 67890123456 I need to make these numbers comma formatted. For example, 12345 => 12,345. Please help. Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Joydeep C
On Sat, 09 May 2020 14:42:43 +0200, Python wrote: > Joydeep wrote: >> I have a Pandas dataframe like below. >> >> XY >> 0 1234567890 1 54321N/A 2 67890123456 >> >> I need to make these numbers comma formatted. For example, 12345 => >> 12,345. > > >>> value = 12345 f

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Joydeep C
On Sat, 09 May 2020 15:46:27 +0200, Python wrote: > Joydeep C wrote: >> On Sat, 09 May 2020 14:42:43 +0200, Python wrote: >> >>> Joydeep wrote: >>>> I have a Pandas dataframe like below. >>>> >>>> XY >>>> 0 12

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Joydeep C
On Sat, 09 May 2020 17:24:41 +0200, Python wrote: > Joydeep C wrote: >> On Sat, 09 May 2020 15:46:27 +0200, Python wrote: >> >>> Joydeep C wrote: >>>> On Sat, 09 May 2020 14:42:43 +0200, Python wrote: >>>> >>>>> Joydeep wrote: >

Getting rid of virtual environments with a better dependency system

2020-11-11 Thread j c
Hello all, I don't know if this suggestion is missing some point, or it's part of something already proposed before. In a professional environment, we've came to a point in which most people use virtual environments or code environments to avoid "polluting a global environment". However, I th

Getting rid of virtual environments with a better dependency system

2020-11-11 Thread j c
Hello all, I don't know if this suggestion is missing some point, or it's part of something already proposed. In a professional environment, we've came to a point in which most people use virtual environments or conda environments to avoid "polluting a global environment". However, I think th

Re: Getting rid of virtual environments with a better dependency system

2020-11-11 Thread j c
On Wednesday, 11 November 2020 at 12:22:24 UTC+1, Chris Angelico wrote: > On Wed, Nov 11, 2020 at 10:06 PM j c wrote: > > > > Hello all, > > > > I don't know if this suggestion is missing some point, or it's part of > > something already propos

Setting a Limit to the Maximum Size of an Upload

2005-10-24 Thread Joey C.
Hello, I'm designing a small "briefcase" program that will allow me to quickly upload, download, and delete files in a briefcase. The only real things that I have left to do are to design a method for checking if the file exists, preventing it from overwriting files from other directories, and set

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-24 Thread Joey C.
Here is a basic overview of the variables included there. params = cgi.FieldStorage() I accidentally made a mistake when typing what the "thefile" variable is. thefile = params["upfile"].file "upfile" is the CGI field that contains the file that I'm uploading. As you can see, the if statement just

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-25 Thread Joey C.
I'm afraid on my interpreter, this works. >>> if os.path.getsize("C:\\Documents and Settings\\Joey\\Desktop\\file.txt") >>> <= 1000: >>> print "<= 1000." <= 1000. No problems there, as you can see. -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-25 Thread Joey C.
Oh, I'm sorry, I didn't understand what you meant at first. Then I read your reply over again and noticed that you said that the problem lied in os.path.getsize() when I tried to run it on the contents of an open file. I'll try the method you outlined now. -- http://mail.python.org/mailman/listi

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-27 Thread Joey C.
Yes, I see that now. I tried your method and it seemed to work fine until I tried printing the filesize out. def checkfilesize(thefile): # Check the Size of the File global filesize thefile.seek(0,2) filesize = thefile.tell() thefile.seek(0) print filesize print conf["upmax"]

Using win32ui.CreateFileDialog() to get the name of a file.

2005-11-19 Thread Joey C.
pears asking user to find a file they want. They double click on the file. Let's call it C:\Video.avi Then another dialog box appears asking them where to save it. They save it at C:\iPodVideo.avi. Now the Python program extracts the name of these files and then uses os.system() to run: me

Re: Using win32ui.CreateFileDialog() to get the name of a file.

2005-11-19 Thread Joey C.
Okay, thank you. This worked very well. -- http://mail.python.org/mailman/listinfo/python-list

python-dev Summary for 2004-10-16 through 2004-10-31

2005-01-01 Thread Brett C.
This is a summary of traffic on the `python-dev mailing list`_ from October 16, 2004 through October 31, 2004. It is intended to inform the wider Python community of on-going developments on the list. To comment on anything mentioned here, just post to `comp.lang.python`_ (or email python-lis

python-dev Summary for 2004-11-16 through 2004-11-30

2005-01-05 Thread Brett C
python-dev Summary for 2004-11-16 through 2004-11-30 This is a summary of traffic on the `python-dev mailing list`_ from November 16, 2004 through November 30, 2004. It is intended to inform the wider Python community of on-going developments

python-dev Summary for 2004-12-01 through 2004-12-15

2005-01-23 Thread Brett C.
Pythonic solution). This didn't get anywhere in the end beyond the idea of a SIG about the various bundling tools (py2app, py2exe, etc.). The other idea was to just stop worrying about speed and move on stomping out bugs and making Python functionally more useful. With modules in

python-dev Summary for 2004-12-16 through 2004-12-31

2005-02-02 Thread Brett C.
This is a summary of traffic on the `python-dev mailing list`_ from December 16, 2004 through December 31, 2004. It is intended to inform the wider Python community of on-going developments on the list. To comment on anything mentioned here, just post to `comp.lang.python`_ (or email python-l

Calling a method using an argument

2005-02-03 Thread C Gillespie
Dear All, I have a simple class class hello: def world(self): return 'hello' def test(self,arg): return self.arg When I want to do is: >hello.test('world') 'hello' i.e. pass the method name as an argument. How should I do this? Thanks Colin -- http://mail.python.org/

Re: Calling a method using an argument

2005-02-04 Thread C Gillespie
Dear All, Many thanks Colin "C Gillespie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dear All, > > I have a simple class > class hello: > def world(self): > return 'hello' > def test(self,arg): > retur

Can we pass some arguments to system("cmdline")?

2005-06-19 Thread Didier C
Hi! I was wondering if we can pass some arguments to system("cmdline")? E.g in Perl, we can do something like: $dir="/home/cypher"; system("ls $dir"); which would instruct Perl to do an "ls /home/cypher" But in python, doing something like dir="/home/cypher" system("ls dir") would cause p

Python linear algebra module -- requesting comments on interface

2005-09-09 Thread C. Barnes
Hi, I'm in the process of writing a Python linear algebra module. The current targeted interface is: http://oregonstate.edu/~barnesc/temp/linalg/ The interface was originally based on Raymond Hettinger's Matfunc [1]. However, it has evolved so that now it is nearly identical to JAMA [2], the

Python linear algebra module -- requesting comments on interface

2005-09-14 Thread C. Barnes
Szabolcs Nagy wrote: >nice interface, but with 3d apps i prefer cgkit's approach, which has >vec3, vec4, mat3, mat4 and quat types with lots of useful functions for >3d graphics (like mat4.looakAt(pos, target, up) or mat3.toEulerXYZ()) >there are other libs with similar types and functions: >cgki

python-dev Summary for 2005-01-01 through 2005-01-15

2005-02-07 Thread Brett C
This is a summary of traffic on the `python-dev mailing list`_ from January 01, 2005 through January 15, 2005. It is intended to inform the wider Python community of on-going developments on the list. To comment on anything mentioned here, just post to `comp.lang.python`_ (or email python-lis

python-dev Summary for 2005-01-16 through 2005-01-31

2005-02-28 Thread Brett C
the proper semantics and will eventually go in for 2.5 (won't touch 2.4 since it is a semantic change). .. _Patch #1109424: http://www.python.org/sf/1109424 Contributing threads: - `__str__ vs. __unicode__ <http://mail.python.org/pipermail/python-dev/2005-Janua

OK, time to retire (was: Re: python-dev Summary for 2005-01-16 through 2005-01-31)

2005-03-01 Thread Brett C.
Steve Holden wrote: Michele Simionato wrote [on c.l.py]: Brett Cannon: [... python-dev summary ... boilerplate change ...] +1 for this idea. The summary looks much better now :) Keep the good work going, Sorry, but i have to disagree. I hope you won't take this reply personally, Michele, since it'

Re: [Python-Dev] Re: OK, time to retire

2005-03-02 Thread Brett C.
[taking python-dev off of the Cc: list] Scott David Daniels wrote: Brett C. wrote: I have decided that I am going to stop doing the python-dev Summaries > after PyCon; the Summary covering the last half of March 2005 will be > it for me. I (as well as most, I'd guess) have enjoyed yo

python-dev Summary for 2005-02-01 through 2005-02-14

2005-03-06 Thread Brett C.
t-forward (use inspect.getmro instead of cls.__mro__), but coming up with a test case was hard -- creating a Python object that doesn't have an __mro__ takes some complicated C code like that of Zope's ExtensionClass. Fortunately, John Lenton's c.l.py_ suggestion to simply raise an

python-dev Summary for 2005-02-15 through 2005-02-28

2005-03-07 Thread Brett C.
Travis Oliphant asked if it would be possible to patch slicing so that any object that defines __int__ could be used. Guido didn't like this idea, though. Float, for instance, has __int__ defined. Guido admitted he "unfortunately copied a design mistake from C here

Ptyon 2.3.5 probably coming in January; get your bugs/patches reported!

2004-12-05 Thread Brett C.
Anthony Baxter, our ever-diligent release manager, mentioned this past week that Python 2.3.5 will most likely come to fruition some time in January (this is not guaranteed date). This means that in order to have enough time to proper evaluate new patches and bugs they must be reported **now**!

spawn or fork

2004-12-08 Thread C Gillespie
Dear All, I have a function def printHello(): fp = open('file','w') fp.write('hello') fp.close() I would like to call that function using spawn or fork. My questions are: 1. Which should I use 2. How do I call that function if it is defined in the same file. Many thanks Colin --

  1   2   3   4   5   6   7   8   9   10   >