Trending questions in Python

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,046 views
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
725 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,145 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
582 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
333 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
332 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
316 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
339 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
275 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
227 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
177 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,166 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
188 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
166 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
41,018 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
875 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
733 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
922 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
694 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
392 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
357 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,764 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
403 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
300 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
252 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
207 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
396 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
386 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
423 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
30,001 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,901 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
228 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
211 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
207 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,140 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,311 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,155 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,996 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,094 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
760 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
473 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
421 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
391 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
385 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
365 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
365 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
366 views