This question already has answers here: How can I parse (read) and use JSON? (5 answers) Closed 24 days ago. 1/ I get my data with this code and then im trying to extract the value of the attribute “sku”: 2/ this is the data that i get. my goal is to extract the value of the attribute “sku&#…
While merging 100+ CSV files, how to fill nan in a column if it doesn’t exist in “usecol”?
Considering that I have CSV files which looks roughly like this I am using the following script which was suggested here Most of the files have all three columns, while few of them do not have ColC. This will give an error (understandably) which is as follows: ValueError: Usecols do not match columns, columns…
Add a filter to timeseries pairs
I have a time series plc tag data as below with values in ‘1’ or ‘0’ Using below code I can get the output Output But my requirement is, I only want to query going back 25 hours, so I add a predicate: But this returns the error: Msg 209 Level 16 State 1 Ambiguous column name ‘dat…
Find all 3^4 permutation using lists
Let’s say I have 4 distinguishable balls, and I want to distribute them into 3 cells (that’s 3^4 different ways of doing that) – how would you suggest me to demonstrate all those 81 different distributions using Python? I want my program to return a list that contains 81 lists, each contain …
Check for max value of iterative sum in pandas
I have a pandas dataframe with some data: I’d like to sum them, one at a time, and at every summation check the totalt sum, an then extract the highest value achieved of the total sum. So the first sum would be element 0, with a value of -0.000601, the send would be -0.000601 + 0.000001=-0.0006, and thi…
Why am I receiving a error when trying to use tkinter to make multiple windows gui?
I am trying to create multiple window GUI application but can’t open window. i received an error. when we run both window code separately it’s run. I don’t know why this error occurs. can anyone resolve this problem. and help me to run multiple frames in one window. This is my first window c…
Python subprocess Popen periodic callback
I am running an HPC simulation on amazon AWS with spot instances. Spot instances can be terminated with 2 minutes notice by AWS. In order to check for termination you need to exectute curl on a spefiic URL every 5 seconds. It is a simple request that returns a json with the termination time, if AWS have initi…
How to specify Search Space in Auto-Sklearn
I know how to specify Feature Selection methods and the list of the Algorithms used in Auto-Sklearn 2.0 I know that Auto-Sklearn use Bayesian Optimisation SMAC but I would like to specify the HyperParameters in AutoSklearn For example, I want to specify random_forest with Estimator = 1000 only or MLP with Hid…
Deleting FlaskForm Fields depending on userinput in other forms
I have 3 forms with Checkboxes to configure the desired form (Final_Form). After the user chooses the desired fields (in form1, form2 and form3), i want to delet all fields that are not required in the final form and render the final form. The reason for that is, that i have 3 Subkategories with around 12 pos…
Replacing chunks of numpy array on condition
Let’s say I have the following numpy array, of 1’s and 0’s exclusively: I want to group all elements into chunks of 3, and replace the chunks by a single value, based on a condition. Let’s say I want [0,1,1] to become 5, and [0,1,0] to become 10. Thus the desired output would be: All p…