Trending questions in Python

0 votes
0 answers

TypeError: not all arguments converted during string formatting python

The program is supposed to take in ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
722 views
0 votes
1 answer

KeyError: "['Place'] not found in axis"

Hi@akhtar, You need to provide the axis parameter ...READ MORE

Jun 24, 2020 in Python by MD
• 95,440 points
40,026 views
0 votes
3 answers

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Nadeem\AppData\Local\Temp\

You have an out of date version ...READ MORE

Dec 15, 2020 in Python by Rajiv
• 8,910 points
37,132 views
0 votes
0 answers

Python - TypeError: 'int' object is not iterable

Here's my code: import math print("Hey, lets solve Task ...READ MORE

Dec 21, 2022 in Python by erzan
• 630 points
576 views
0 votes
0 answers

What should I do with "Unexpected indent" in Python?

How do I rectify the error "unexpected ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
328 views
0 votes
0 answers

Print without space in python 3

I'm new to Python, and I'm wondering ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
323 views
0 votes
0 answers

Python Key Error=0 - Can't find Dict error in code

basically I have been racking my brains ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
308 views
0 votes
0 answers

How do I update/upgrade pip itself from inside my virtual environment?

I'm able to update pip-managed packages, but ...READ MORE

Dec 21, 2022 in Python by erzan
• 630 points
334 views
0 votes
0 answers

python: SyntaxError: EOL while scanning string literal

I have the above-mentioned error in s1="some ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
270 views
0 votes
0 answers

Function for factorial in Python

How do I go about computing a ...READ MORE

Dec 21, 2022 in Python by erzan
• 630 points
225 views
0 votes
0 answers

What do these operators mean (** , ^ , %, //)? [

Other than the standard +, -, *and / operators; but what does ...READ MORE

Dec 21, 2022 in Python by erzan
• 630 points
176 views
0 votes
0 answers

What does the "yield" keyword do?

What is the use of the yield keyword in ...READ MORE

Dec 21, 2022 in Python by erzan
• 630 points
166 views
0 votes
0 answers

Removing duplicates in lists

How can I check if a list ...READ MORE

Dec 20, 2022 in Python by erzan
• 630 points
187 views
0 votes
3 answers

How to replace negative numbers in Pandas Data Frame by zero?

 If all your columns are numeric, you ...READ MORE

Dec 16, 2020 in Python by Rajiv
• 8,910 points
43,124 views
0 votes
0 answers

Python list error: [::-1] step on [:-1] slice

I thought I understood the basics of ...READ MORE

Dec 20, 2022 in Python by erzan
• 630 points
165 views
0 votes
1 answer

How do I install the yaml package for Python?

Hello @kartik, You could try the search feature ...READ MORE

May 12, 2020 in Python by Niroj
• 82,880 points
40,957 views
0 votes
0 answers

Visualize the full chess board from the library python-chess on line command

I am working a chess game based ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
863 views
0 votes
0 answers

Object Oriented Python for area of triangle

Write a Python Program(with class concepts) to ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
729 views
0 votes
0 answers

Random word generator in Python

I'm essentially working on a project where ...READ MORE

Nov 17, 2022 in Python by Samuel
• 460 points
915 views
0 votes
0 answers

How do you move tree with ignore patterns in python

with the shutil.copytree I can copy an ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
685 views
0 votes
0 answers

'for' loop in one line in Python

When I tried to use a for statement in ...READ MORE

Nov 24, 2022 in Python by sarit
• 1,830 points
385 views
0 votes
0 answers

How can I find the first occurrence of a sub-string in a python string?

I'd like to locate the first index ...READ MORE

Nov 24, 2022 in Python by sarit
• 1,830 points
353 views
0 votes
0 answers

python reverse phone lookup with twilio

I've been trying to figure out how ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
401 views
0 votes
1 answer

What is the full form of oops?

To answer your doubt, the programming paradigm ...READ MORE

Feb 8, 2022 in Python by Soham
• 9,700 points
12,746 views
0 votes
0 answers

Is it possible to get a list of keywords in Python?

I want to obtain a string list ...READ MORE

Nov 24, 2022 in Python by sarit
• 1,830 points
299 views
0 votes
0 answers

Repeating triangle pattern in Python

Depending on the integer input, I need ...READ MORE

Nov 24, 2022 in Python by sarit
• 1,830 points
297 views
0 votes
0 answers

How to check whether a variable is a class or not?

I was wondering how to check whether ...READ MORE

Nov 24, 2022 in Python by sarit
• 1,830 points
247 views
0 votes
0 answers

How can I "count from the back" in python lists?

Say I have a list l = ['P','y','t','h','o','n'] I ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
205 views
0 votes
0 answers

Python list error: step on slice with [:-1]

I believed I was familiar with the ...READ MORE

Nov 17, 2022 in Python by Samuel
• 460 points
394 views
0 votes
0 answers

In Python, how do I declare an array?

In Python, how do I declare an ...READ MORE

Nov 17, 2022 in Python by Samuel
• 460 points
384 views
0 votes
0 answers

Concatenating two one-dimensional NumPy arrays

How do I concatenate two one-dimensional arrays ...READ MORE

Nov 16, 2022 in Python by Ashwini
• 5,430 points
421 views
0 votes
3 answers

Best way to convert string to bytes in Python?

We can use the built-in Bytes class in Python ...READ MORE

Dec 28, 2020 in Python by David Samon
29,948 views
0 votes
0 answers

What is the primary language used to create Python?

What is the primary language used to ...READ MORE

Nov 17, 2022 in Python by Samuel
• 460 points
221 views
+1 vote
1 answer

How to get the currently logged in user's user id in Django?

Hello @kartik, First make sure you have SessionMiddleware and AuthenticationMiddleware middlewares added ...READ MORE

Aug 12, 2020 in Python by Niroj
• 82,880 points
35,864 views
0 votes
0 answers

How to define a two-dimensional array?

The following is how I want to d ...READ MORE

Nov 17, 2022 in Python by Ashwini
• 5,430 points
207 views
0 votes
0 answers

In Python, what does a "r" mean before a string?

In Python, what does a "r" mean ...READ MORE

Nov 17, 2022 in Python by Samuel
• 460 points
204 views
0 votes
3 answers

import NumPy as np ImportError: No module named NumPy

You need to install numpy using pip install ...READ MORE

Dec 16, 2020 in Python by Roshni
• 10,520 points
35,126 views
0 votes
1 answer

ValueError: could not convert string to float: id

The problem is that in your code ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,420 points
8,295 views
+2 votes
2 answers

ImportError: numpy.core.multiarray failed to import

try this... run this code one by one.... pip ...READ MORE

Nov 5, 2020 in Python by Anand Vijay Rajsri

reshown Nov 5, 2020 by Sirajul 34,078 views
0 votes
0 answers

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I am facing an error when decoding ...READ MORE

May 9, 2022 in Python by Kichu
• 19,050 points
6,991 views
0 votes
1 answer

How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip

Just add the package containing the executable pg_config. ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,420 points
7,082 views
0 votes
0 answers

Error: 'int' object is not subscriptable - Python

I was experimenting with a straightforward piece ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
757 views
0 votes
0 answers
0 votes
0 answers

What does an 'r' represent before a string in python?

Why do we put a r before ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
463 views
0 votes
0 answers

'python' is not recognized as an internal or external command [duplicate]

I recently got Python Version 2.7.5, and ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
417 views
0 votes
0 answers

Base language of Python

What is the base language is Python ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
387 views
0 votes
0 answers

'str' object has no attribute 'decode'. Python 3 error?

'decode' is not an attribute of the ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
383 views
0 votes
0 answers

Replacements for switch statement in Python?

I want to create a Python function ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
363 views
0 votes
0 answers

Does "IndexError: list index out of range" when trying to access the N'th item mean that my list has less than N items?

I'm instructing my software to print out ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
357 views
0 votes
0 answers

How can I convert a list to a string using Python?

How can I convert a list to ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
361 views