Rename the label in tkinter

I work with tkinter. I want to change the name of the labels. By entering the characters in the field and hitting the button, the labels are renamed one by one. That is, the first time I enter the …

loop over series of dictionaries to convert to DataFrames

I have that list of dictionaries in several rows that I need to loop over to create new DataFrame. I have tried the following loop: for key, value in s.items(): print(key + ” : ” + str(…

Fastest way to get values from dictionary to another dictionary in python without using if?

I need to find a way to get values from one dictionary to another, bases on key name match without using two loops if statement. Main goal is to make it run more efficiently since it’s a part of a …

How do I make a program keep repeating until I input a specific data that stops it?

I’m trying to make a program in python so that when I input a number from 1 to 10, a specific set of program goes on and asks for another number from 1 to 10 and runs another program, until I enter 0(…

How to find the maximum number in python repeatedly from a group of numbers

I have a numpy array like below: [12,544,73,56,30,84,34,29,78,22,73,23,98,83,35,62,52,94,44,67] In this data there are 20 numbers and they are divided in 4 groups with 5 numbers in each group. so …

Check column for variable and get value from another column in matched row

How can I get the values of one column in a csv-file by matching attributes in another column? CSV-file would look like that: One,Two,Three x,car,5 x,bus,7 x,car,9 x,car,6 I only want to get the …

Is it possible to get binary count from Counter() Python

Using Counter(), I want to do a binary count of variables in a list. So instead of getting the count for each variable, I would simply like to have a Counter() variable, in which all values are one. …

How do I create a linear regression model for a file that has about 500 columns as y variables? Working with Python

This code manually selects a column from the y table and then joins it to the X table. The program then performs linear regression. Any idea how to do this for every single column from the y table? …

How can I avoid for-loops using pandas?

Would love to know how to optimize this code without using for-loops, if it’s possible. What I’m trying to do is to categorize all the values in series df[‘Состояние’] looking at key words in lists …

What is best way to loop through Pandas dataframe employing a sequentially counted value in each row where condition is true?

Business Problem: For each row in a Pandas data frame where condition is true, set value in a column. When successive rows meet condition, then increase the value by one. The end goal is to create a …