Most voted questions in Python

+1 vote
1 answer

How to replace id with attribute corresponding to id of another table?

Use the following query statement and let ...READ MORE

Aug 8, 2018 in Python by Priyaj
• 58,020 points
3,018 views
+1 vote
1 answer

How can I map input to output without using dynamic()

Here am talking about my example you ...READ MORE

Aug 8, 2018 in Python by Priyaj
• 58,020 points
1,363 views
+1 vote
1 answer

Why is openpyxl is required for loading excel format files?

Well, it sounds like openpyxl is not ...READ MORE

Aug 8, 2018 in Python by Priyaj
• 58,020 points
1,546 views
+1 vote
2 answers

Measuring the distance between pixels on OpenCv with Python

You can try this: Mat pts1(nPts, 1, CV_8UC2), ...READ MORE

Aug 24, 2018 in Python by Omkar
• 69,180 points
11,078 views
+1 vote
1 answer

How to create plots using python matplotlib in IPython notebook?

I think you should try: I used %matplotlib inline in ...READ MORE

Aug 8, 2018 in Python by Priyaj
• 58,020 points
2,167 views
+1 vote
12 answers

How to print array/ list without brackets in python?

print(*names, sep = ', ') This is what ...READ MORE

Dec 10, 2018 in Python by Sudo
147,018 views
+1 vote
7 answers

What do you mean by python scripting? What is a script and a module in python?

A module is a file containing a ...READ MORE

Jun 17, 2019 in Python by Zain Abbas
66,670 views
+1 vote
4 answers

Comparing input functions

In Python raw_input() allows you to enter ...READ MORE

Oct 18, 2018 in Python by fuji
2,363 views
+1 vote
8 answers

Count the frequency of an item in a python list

To count the number of appearances: from collections ...READ MORE

Oct 18, 2018 in Python by tinitales
37,009 views
+1 vote
4 answers

How can I concatenate str and int objects?

If you want to concatenate int or ...READ MORE

Oct 18, 2018 in Python by subhm
1,841 views
+1 vote
2 answers

View onto a numpy array?

 just index it as you normally would. ...READ MORE

Oct 18, 2018 in Python by roberto
1,504 views
+1 vote
5 answers

convert string to int python

Using list comprehensions: t2 = [map(int, list(l)) for ...READ MORE

Oct 18, 2018 in Python by donald
2,352 views
+1 vote
6 answers

How python trim works

You want strip(): myphrases = [ " Hello ...READ MORE

Oct 18, 2018 in Python by up4rescue
2,057 views
+1 vote
4 answers

How to write nested dictionaries to a CSV file

Using DictWriter there is no need in ...READ MORE

Oct 18, 2018 in Python by Richard William
28,710 views
+1 vote
5 answers

Check whether the file exists or not?

Use this import os os.path.exists(path) # Returns whether the ...READ MORE

Oct 18, 2018 in Python by reyam
2,498 views
+1 vote
2 answers

How to resize the image canvas to maintain a square aspect ratio

down voteacceptedUsing OpenCVYou can use resize() in OpenCV to ...READ MORE

Apr 4, 2018 in Python by charlie_brown
• 7,720 points

edited Jul 11, 2023 by Khan Sarfaraz 2,194 views
0 votes
0 answers

Reading different format files from s3 having decoding issues using boto3

Am Trying to read text from different ...READ MORE

May 17, 2024 in Python by anonymous

edited Mar 5 254 views
0 votes
1 answer

What is the algorithm to find the sum of prime numbers in the input in python

To find the sum of prime numbers ...READ MORE

Mar 1, 2024 in Python by Shubh Saxena
1,664 views
0 votes
1 answer

How to Concatenate Lists in Python?

In Python, you can concatenate lists using ...READ MORE

Dec 29, 2023 in Python by Anu
1,163 views
0 votes
1 answer

Sum of prime numbers from m to n in python

def is_prime(number):     if number < 2:         return False     for i ...READ MORE

Jan 5, 2024 in Python by Ali
1,666 views
0 votes
1 answer

What does // means in Python?

In Python, when you use //, it ...READ MORE

Dec 29, 2023 in Python by Vani
1,135 views
0 votes
1 answer

Command python execinterminal icon not found

When the "command Python execInTerminal" icon or ...READ MORE

Nov 29, 2023 in Python by anonymous
• 3,360 points
3,463 views
0 votes
1 answer

Why am I getting the syntax error SyntaxError invalid syntax in a line that contains fully valid syntax?

A "SyntaxError: invalid syntax" is a common ...READ MORE

Oct 18, 2023 in Python by anonymous
• 3,360 points
1,495 views
0 votes
0 answers

root = tk.TK() ERROR, i dont get why ???

import tkinter as tk from tkinter import ttk # ...READ MORE

Oct 3, 2023 in Python by anonymous

edited Mar 5 181 views
0 votes
1 answer

What do "init" and "self" do in python ?

In Python, `init` and `self` are related ...READ MORE

Oct 5, 2023 in Python by anonymous
• 3,360 points
1,259 views
0 votes
1 answer

Python urllib2 login to minecraft net

Why not use Selenium over urllib? Selenium ...READ MORE

Sep 25, 2023 in Python by Rajarshi
• 470 points
832 views
0 votes
0 answers

What is print(f"...") ?

I'm looking at a Python script that ...READ MORE

Sep 18, 2023 in Python by Satyawrat
• 460 points

edited Mar 5 145 views
0 votes
0 answers

What is print(f"...")

I'm looking at a Python script that ...READ MORE

Sep 18, 2023 in Python by Satyawrat
• 460 points

edited Mar 5 168 views
0 votes
0 answers
0 votes
0 answers

How do I use Python to change YOLO format comments to x1, y1, x2, y2 coordinates?

I want to know how to change ...READ MORE

Sep 16, 2023 in Python by Satyawrat
• 460 points

edited Mar 5 162 views
0 votes
0 answers

How do I install opencv using pip?

I need to install cv2 for a ...READ MORE

Sep 13, 2023 in Python by Rahul
• 240 points
1,041 views
0 votes
0 answers
0 votes
0 answers
0 votes
0 answers

In Python, retrieve color palettes from the website ColorHunt.co.

I am presently engaged in the development ...READ MORE

Sep 12, 2023 in Python by Satyawrat
• 460 points
682 views
0 votes
0 answers

What do the python file extensions, .pyc .pyd .pyo stand for?

What do these python file extensions mean? .pyc .pyd .pyo What ...READ MORE

Sep 12, 2023 in Python by Rahul
• 240 points

edited Mar 5 166 views
0 votes
0 answers

What do the three different types of brackets in Python code mean? I'm not sure if this is right, so if I'm wrong, please tell me:

[] - Normally used for dictionaries, list items () - ...READ MORE

Sep 11, 2023 in Python by Satyawrat
• 460 points
508 views
0 votes
0 answers

How to find the number of a list item ?

Given a list ["foo", "bar", "baz"] and ...READ MORE

Sep 11, 2023 in Python by Satyawrat
• 460 points
533 views
0 votes
0 answers

If I want to find the sum of a number's numbers, such as:

Input: 932 Output: 14, which is (9 + 3 + 2) What ...READ MORE

Sep 11, 2023 in Python by Satyawrat
• 460 points

edited Mar 5 168 views
0 votes
0 answers

I'm making a Python program to do math, figure out answers, and so on, but I'm getting the syntaxerror: "unexpected character after line continuation character in python."

This is my code: print("Length between sides: "+str((length*length)*2.6)+" ...READ MORE

Sep 7, 2023 in Python by Satyawrat
• 460 points
819 views
0 votes
0 answers

I have a very long list of datetime strings like these:

["Jun 1 2005 1:33PM", "Aug 28 1999 ...READ MORE

Sep 7, 2023 in Python by Satyawrat
• 460 points
602 views
0 votes
0 answers

Is it okay for general applications to use the RuntimeError exception?

raise RuntimeError('config file is missing host address') I've ...READ MORE

Sep 7, 2023 in Python by Satyawrat
• 460 points
419 views
0 votes
0 answers

How to use the open with statement to open a file

I'm researching file input and output in ...READ MORE

Sep 6, 2023 in Python by Satyawrat
• 460 points
717 views
0 votes
0 answers
0 votes
0 answers

How does super() operate in the presence of multiple inheritance? As an example, consider the following:

class First(object): def __init__(self): ...READ MORE

Sep 6, 2023 in Python by Satyawrat
• 460 points
525 views
0 votes
0 answers

What does %s in a Python format string mean?

For example, in the below code if len(sys.argv) ...READ MORE

Sep 5, 2023 in Python by Satyawrat
• 460 points
640 views
0 votes
0 answers

How to sort a dictionary using key?

Example input: {2:3, 1:89, 4:5, 3:0} Desired output: {1:89, 2:3, ...READ MORE

Sep 4, 2023 in Python by Satyawrat
• 460 points
670 views
0 votes
0 answers

How to sum the values of a JavaScript object?

I'd like to sum the values of ...READ MORE

Sep 1, 2023 in Python by Edureka
• 220 points
379 views