Should PyImport_ImportModule be threadsafe when importing from zipfiles?

2020-02-20 Thread Geoff Bache
Hi all, I have some embedded Python code which looks like this in C++ _gstate = PyGILState_Ensure(); PyImport_ImportModule("a"); ... PyGILState_Release(_gstate); and is called from different threads which are created in C++. My module a.py then imports another module b in python, which defines

What's the best forum to get help with Pandas?

2020-02-20 Thread Luca
subject has it all. Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Paper Print Help

2020-02-20 Thread Rhodri James
On 20/02/2020 15:08, Duram wrote: On 19/02/2020 12:17, Rhodri James wrote: On 19/02/2020 14:22, Duram via Python-list wrote: I have a drawing in a .gif file with (a,b) pixels and want to paperprint it in a position (x,y), what would be the code? What have you tried? Nothing, I did not find

Re: Should PyImport_ImportModule be threadsafe when importing from zipfiles?

2020-02-20 Thread Chris Angelico
On Fri, Feb 21, 2020 at 2:37 AM Geoff Bache wrote: > When several threads execute this simultaneously I often get a stacktrace > saying some function near the end of module b is not defined, presumably > because the module has been imported part-initialised. > This only seems to happen when my Pyt

Re: Pandas rookie

2020-02-20 Thread musbur
On Wed, 19 Feb 2020 17:15:59 -0500 FilippoM wrote: > How can I use Pandas' dataframe magic to calculate, for each of the > possible 109 values, how many have VIDEO_OK, and how many have > VIDEO_FAILURE I have respectively? crosstab() -- https://mail.python.org/mailman/listinfo/python-list

Re: What's the best forum to get help with Pandas?

2020-02-20 Thread Skip Montanaro
I believe the Pandas people tend to refer people to Stack Overflow. I find that suboptimal as many questions go completely unanswered or get gruff responses. Aside from that, I suspect this list is as good a place as any to request help. Skip -- https://mail.python.org/mailman/listinfo/python-lis

Re: Should PyImport_ImportModule be threadsafe when importing from zipfiles?

2020-02-20 Thread Chris Angelico
On Fri, Feb 21, 2020 at 3:06 AM Geoff Bache wrote: > > Hi Chris, > > Yes, I've tried both of these things already. I can confirm there are > multiple calls, and that pre-importing the module fixes it. But pre-importing > it is not a solution in practice. > Cool, good to know. Crazy idea: What

Re: Should PyImport_ImportModule be threadsafe when importing from zipfiles?

2020-02-20 Thread Geoff Bache
Hi Chris, Yes, I've tried both of these things already. I can confirm there are multiple calls, and that pre-importing the module fixes it. But pre-importing it is not a solution in practice. Regards, Geoff On Thu, Feb 20, 2020 at 4:45 PM Chris Angelico wrote: > On Fri, Feb 21, 2020 at 2:37 AM

Idiom for partial failures

2020-02-20 Thread David Wihl
 (first post) I'm working on the Python client library [0]for the Google Ads API [1]. In some cases, we can start a request with a partial failure [2] flag = True. This means that the request may contain say 1000 operations. If any of the operations fail, the request will return with a success

Machine Learning program outputting wrong things

2020-02-20 Thread rgladkik
I am writing a program for an assignment (in a course I am auditing). I am pasting it below: # Assignment 2 skeleton code # This code shows you how to use the 'argparse' library to read in parameters import argparse import math import matplotlib.pyplot as plt import numpy as np import pandas

Re: Idiom for partial failures

2020-02-20 Thread Ethan Furman
On 02/20/2020 09:30 AM, David Wihl wrote: I'm working on the Python client library for the Google Ads API. In some cases, we can start a request with a partial failure flag = True. This means that the request may contain say 1000 operations. If any of the operations fail, the request will ret

Re: Idiom for partial failures

2020-02-20 Thread Rob Gaddi
On 2/20/20 9:30 AM, David Wihl wrote:  (first post) I'm working on the Python client library [0]for the Google Ads API [1]. In some cases, we can start a request with a partial failure [2] flag = True. This means that the request may contain say 1000 operations. If any of the operations fail

Re: Idiom for partial failures

2020-02-20 Thread Tim Chase
On 2020-02-20 13:30, David Wihl wrote: > I believe that it would be more idiomatic in Python (and other > languages like Ruby) to throw an exception when one of these > partial errors occur. That way there would be the same control flow > if a major or minor error occurred. There are a variety of

Re: Idiom for partial failures

2020-02-20 Thread Richard Damon
On 2/20/20 12:30 PM, David Wihl wrote:  (first post) I'm working on the Python client library [0]for the Google Ads API [1]. In some cases, we can start a request with a partial failure [2] flag = True. This means that the request may contain say 1000 operations. If any of the operations fai

Re: Idiom for partial failures

2020-02-20 Thread DL Neil via Python-list
On 21/02/20 10:05 AM, Stefan Ram wrote: David Wihl writes: I believe that it would be more idiomatic in Python (and other languages lik= e Ruby) to throw an exception when one of these partial errors occur. I wonder whether the term "idiomatic" is too heavily burdened here. Python o

Asyncio question

2020-02-20 Thread Frank Millman
Hi all I use asyncio in my project, and it works very well without my having to understand what goes on under the hood. It is a multi-user client/server system, and I want it to scale to many concurrent users. I have a situation where I have to decide between two approaches, and I want to cho