I have a large data set of machine speeds per simulation. I have a column or which simulation it is as well as columns for the different machines. Now I would like to have different lists of the sum of each machine per simulation so that I can do analysis on this as well as create plots for it. Here
Tag: python
numpy array –> sort descending unique values base count of values
I have a numpy array: I want the same unique array back, but sorted descending in the order of occurrences of the elements. In this example, 6 occurs 3 times, 1 occurs 2 times and all the other elements only occur 1 time, so the result should be: Does anyone know how this can be done? Thanks in advance! Answe…
How can I improve processing time with threads on Spyder?
I’m trying to change the date format of a column in a CSV. I know there are easier ways to do this, but the goal here is to get the threads working properly. I work with Spyder and Python 3.8. My code works as follows: I create a thread class with a function to change the date format I split
Issue with Subprocess Popen Python
I searched on stack overflow but I did’nt find a correct answer. I use subprocess popen to call and run an entire python script and it works fine, like that : subprocess.Popen([‘python3’, ‘/home/pc/Dossier/Dossier2/Nom.py’], ) But in my system I want to modify a variable in the s…
How to Display python script Error in Tkinter message box
I have written the below code for run a python file on button click through tkinter and also displaying two button for run python file on GUI window. Now my pyhton files is working fine when click on button. But there is one issue is I want to shows error on tkinter error box whatever error shows on cmd windo…
Can not find library valkka
I try to use this library to control my ptz cameras https://elsampsa.github.io/valkka-examples/_build/html/index.html instead of https://github.com/FalkTannhaeuser/python-onvif-zeep. In tutorial page, https://elsampsa.github.io/valkka-examples/_build/html/onvif.html I see the next example: but I can’t f…
extract key and values from nested jsons and put in a DataFrame
I have a json object that looks like this: Is it possible to extract all dates (key) along with their respective “revenue” values and put them into a dataframe that looks likethis: Answer How about something like:
extract extreme values from xarray dataarray
I have a rather large dataset, and need to find in that dataset extreme values, including coordinates. The real dataset is much larger, but let’s take this one for testing: I want to find in this dataarray all values larger than 2. I found on here this solution: but even in this small example, this prod…
User Input to set dynamic variable Python
I made a simple random.choice code by myself. But there is a major problem with it. I can’t take user input to dynamically set variables. What I’m trying to achieve is taking a user input and setting that as zorluk_secimi and after that if it matches to a category it will pick a random word from t…
Python to Find-replace a string and Create Two Paragraphs Before String in Words Document
I have a VBA Macro. In that, I have Here, ‘^p^pChemical’ means Replace the Word Pollution with Chemical and create two empty paragraphs before the word sea. Before: After: Have you noticed that The Word Pollution has been replaced With Chemical and two empty paragraphs preceds it ? This is how I w…