Hi I’ve got json data that looks something like this: I’m looking to convert this into lists that look something like this: So far I’ve been able to get all the names that I want using objectpath. But I’ve been unable to get the appropriate headers for each name as it appears to be nes…
Tag: python
reshape the array with specific form
I have an specific array which each rows has to array. I want to reshape it. But, I don’t know how to reshape it to a 2d array. Here is my array: Here is the desired output: Any help appreciated. Thanks I’ve tried to use the reshape. But, it does not solve. Answer It’s ragged, it’s not…
DataFrame contains a column of dates which are having these types: “‘5-15-2019′” and 05152021.I want to extract pattern of it
DataFrame contains dates which are having these types: “21-10-2021” and 29052021.I want to extract pattern of it. for example ‘5-15-2019’,it needs to produce ‘%d-%m-%Y’ ‘05152021’ it needs to produce ‘%d%m%Y’ i tried in this way: output: i got a list…
How would I get all elements with a specific XPATH, get the lowest price among them, then get the title of it? [Using Selenium]
I’m working on something to scrape all element texts, somehow sort the number and get the title in it. I’ve gotten to the point where I can print all element texts but I can’t seem to get the lowest number and title. I’m also only trying to get the elements that are “CARdano4SPEE…
How to filter after two joins in flask SQL alchemy
I have the following 3 tables: Each sample has a chain of processes it goes through and I need to get a table which includes both Sample.id and the latest date it has encountered a process, so that I can filter by this date. Something like this What I tried so far was looking at this and similar solutions: ht…
Extracting Transfer learning output from CNN Keras
How to take the intermediate Transfer learning output. ? Eg: Tried: Answer There’s an unresolved issue in Tensorflow on this problem. According to the issue, you need to pass inputs of both outer model and inner model to get the output of inner model.
How to extract multiple job url from a jobpost using python webscrapping
I have so far created the below code, to extract all the informations, but I cant figure out how to extract the link. I have tried with a for loop, but i get differents links. I really hope anyone can point me at the right direction. Answer You can combine an attribute = value css selector with contains * ope…
validating parameter dictionaries before insertion in datajoint schema
We’d like to enforce parameter checking before people can insert into a schema as shown below, but the code below doesn’t work. Is there a way to implement pre-insertion parameter checking? Answer This is a great question that has come up many times for us. Most likely the issue is either that you…
checking if message author has a certain role
I am making an automatic banning system with a discord bot. So once a message with a steam id is placed into the channel, it will run through an API and ban them (I’ve got this working) what I am looking for is to check if that user has a certain role or not. For this I am using a
Pandas UDF throws error not of required length
I have a delta table which has thrift data from kafka and I am using a UDF to deserialize it. I have no issues when I use regular UDF, but I get an error when I try to use Pandas UDF. This runs fine i.e. ruglar UDF But when I use Pandas UDF I get an error PythonException: ‘RuntimeError: Result