I’m working on a bot for discord that tracks information related to a game. I would like staff members to alter the data of regular players with a bot command. Is there a way to grab the mention out of the command? &do_thing @target specifics I’m familiar with extracting the nickname and discord ID for the author. I need to
Replacing list comprehensions with pandas and numpy Python
The function below uses slices to get the maximum value between 2 indexes at once. So it gets the maximum value between 0 and 10 and then 10 and 12 and such. The function is derived from the answer to this post post. Is there a way I could could replace the list comprehensions in the form of a pandas
How to move a document between 2 collections in Firebase?
I’m trying to “move” a document from one collection to another in Firestore. That means copy/paste a document and then delete the original. I’m trying to achieve this server-side using Python. I’m aware that using transactions might do the trick, but I’m wondering why couldn’t I just use a basic : .get() .set() and .delete() in order to do that?
Exporting data as CSV file from ServiceNow instance using Python
I have some data in an instance that I would like to export to a CSV file using Python and the REST API. I wish to use REST, because there are some rows missing when emailed as a .CSV file. The query gives me 12,000 rows, however, the file that is emailed to me only contains 10,001 rows. Here is
python tkinter “in” operator doesn’t work
my problem is the programme won’t state the answer as correct only if you put the answer alone, but i want to make that you can actually put a phrase in the entry widget and if the answer is in that phrase it would say correct, i made this work without tkinter but i canno’t make it work in tkinter
Python – Scraping a PDF file from a URL
I want to scrape pdf files from this site https://www.sigmaths.net/Reader.php?var=manuels/ph/physique_pilote_7b.pdf I tried this code for that but it doesn’t work. Can anybody tell me why, please? Answer your url is pointing to a reader https://www.sigmaths.net/Reader.php?var=manuels/ph/physique_7b.pdf, remove the ‘reader.php?var= for the actual pdf
duplicated rows in pandas append inside for loop
I am having trouble with a for loop inside a function. I am calculating cosine distances for a list of word vectors. with each vector, I am calculating the cosine distance and then appending it as a new column to the pandas dataframe. the problem is that there are several models, so i am comparing a word vector from model
Calculating the sum of the quantities of one dataframe based on dates in another dataframe (Python)
Suppose I have a first df like this: df1: I also have a second df (df2) with the items, a date and a quantity df2: Now I want to sum the quantities from df2 where the date is between the columns date1 and date2. So my result would look like: df3: I’ve been starring at it for a while now
Kubernetes python client equivalent of “kubectl wait –for ” command
I am using kubernetes-client/python and want to write a method which will block control until a set of Pods is in Ready state (Running state). I found that kubernetes supports wait –for command for doing same thing via command. Can someone please help me with how to achieve same functionality using kubernetes python client. To be precise i am mostly
Proplot colorbar from custom cmap
I’d like to add a colorbar to my figure from a Colormap object rather than using a mappable (such as returned from imshow. From the docs I think this should be possible using option 4. I’m using the following code: This gives the following result: Which almost what I want but I’d like to color bar values to ranges from