Most viewed questions in Python

0 votes
1 answer

Snake head now showing when trying to build the snake game using python module turtle

Hey @Nagya, so you added the following ...READ MORE

Jun 19, 2019 in Python by Faiza
1,074 views
0 votes
1 answer

Length and dimensions of NumPy arrays

The length of NumPy arrays can be ...READ MORE

Jun 14, 2019 in Python by Wajiha
• 1,950 points
1,074 views
0 votes
1 answer

How do I remove/delete a folder that is not empty?

import shutil shutil.rmtree('/folder_name') By design, rmtree fails on folder trees containing ...READ MORE

Dec 7, 2020 in Python by Gitika
• 65,910 points
1,071 views
0 votes
1 answer

How to declare an array in Python?

variable = [] Now variable refers to an empty list*. Of ...READ MORE

Jan 5, 2021 in Python by Gitika
• 65,910 points
1,068 views
0 votes
1 answer

Cherrypy vs. Apache/mod_wsgi

In my experience the best performance is ...READ MORE

Jul 12, 2019 in Python by SDeb
• 13,300 points
1,068 views
0 votes
0 answers

Reading powershell clixml in python

I have an XML file that was ...READ MORE

Oct 5, 2018 in Python by eatcodesleeprepeat
• 4,710 points
1,068 views
0 votes
1 answer

python: Syntax Error: EOL while scanning string literal

There are many ways to deal with ...READ MORE

Feb 5, 2022 in Python by Dev
• 6,000 points
1,067 views
+1 vote
1 answer

How do I create a slug in Django?

Hello @kartik, You will need to use the ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,880 points
1,067 views
0 votes
0 answers
0 votes
1 answer

Creating a login page, when passing json values showing me error?<class 'NoneType'>???

#appriciate your helping email = input("enter your email ...READ MORE

Nov 17, 2020 in Python by rehan
• 160 points
1,066 views
0 votes
1 answer

How to split a large sample of text into words in Python?

Hi@akhtar, You can use nltk module to split your text ...READ MORE

Jun 26, 2020 in Python by MD
• 95,440 points
1,066 views
0 votes
1 answer

OSX 10.11 with py2app?

I'm not sure if this is your ...READ MORE

May 9, 2018 in Python by charlie_brown
• 7,720 points
1,066 views
0 votes
1 answer

How to change one character in a string in Python?

Python strings are immutable, you change them ...READ MORE

Dec 4, 2018 in Python by Nymeria
• 3,560 points
1,065 views
0 votes
1 answer

the syntax getting error solve it please

Hi@shahzad, Your dataset contains a string value. You ...READ MORE

Jun 18, 2020 in Python by MD
• 95,440 points
1,064 views
0 votes
1 answer

When to use file vs open in Python?

File() has been removed since Python 3.0 ...READ MORE

Oct 30, 2018 in Python by SDeb
• 13,300 points
1,064 views
0 votes
1 answer

Why do lambdas defined in a loop with different values all return the same result?

Here x is not local to the ...READ MORE

Jul 24, 2019 in Python by Haseeb
1,062 views
+4 votes
3 answers

What does these operator mean **, ^, %, // ?

** - Performs exponential (power) calculation on ...READ MORE

Apr 12, 2018 in Python by anto.trigg4
• 3,440 points
1,060 views
0 votes
1 answer

web scraping using python

Hey, @Pythonist, You can try this, ##################################### Method 1 import ...READ MORE

May 6, 2020 in Python by Gitika
• 65,910 points
1,059 views
0 votes
1 answer

ImportError: No module named mpmath. But mpmath has been installed.

You should use conda to install Python ...READ MORE

Nov 4, 2020 in Python by Gitika
• 65,910 points
1,058 views
0 votes
1 answer

Is there a tool to help find bugs or perform static analysis?

There are two tools that I'm aware ...READ MORE

Jun 7, 2019 in Python by Adarsh
1,058 views
0 votes
1 answer

formatting_info=true for xlsx file handling

There are 2 libraries used to handle ...READ MORE

Mar 19, 2019 in Python by Omkar
• 69,210 points
1,058 views
0 votes
2 answers

How to use threading in Python?

 Thread is the smallest unit of processing that ...READ MORE

Apr 6, 2019 in Python by anonymous
1,058 views
0 votes
1 answer

How to find index from raw and column in python?

You probably want to use np.ravel_multi_index: import numpy as ...READ MORE

Sep 24, 2018 in Python by Priyaj
• 58,090 points
1,057 views
0 votes
1 answer

How can I combine two dataframes in Python Pandas?

Hi, You can use the following methods to ...READ MORE

Jun 25, 2019 in Python by Shabnam
• 930 points
1,055 views
0 votes
1 answer

What are data structures in python?

Data structures in python are basically the ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
1,054 views
0 votes
1 answer

how to install pandas in python

it is very basic to install pandas if ...READ MORE

Mar 6, 2019 in Python by Waseem
• 4,540 points
1,050 views
0 votes
1 answer

What is absolute import in Python and how is it used?

An absolute {import, path, URL} tells you exactly how ...READ MORE

Nov 30, 2018 in Python by Nymeria
• 3,560 points

edited Dec 10, 2018 by Nymeria 1,049 views
0 votes
1 answer

ModuleNotFoundError: No module named 'testfixtures'

Hi@akhtar, It seems you don't have this module ...READ MORE

Jul 15, 2020 in Python by MD
• 95,440 points
1,048 views
0 votes
1 answer

Find tag starting with a particular letter using BeautifulSoup?

Try something like this: for tag in soup.find_all(re.compile("^b")): ...READ MORE

Apr 2, 2019 in Python by Taj
1,046 views
0 votes
1 answer

How to use Pandas HDF5 as a Database in Python?

HDF5 works fine for concurrent read only ...READ MORE

Nov 30, 2018 in Python by Nymeria
• 3,560 points

edited Dec 10, 2018 by Nymeria 1,045 views
0 votes
1 answer

Numpy: Multiplying large arrays with dtype=int8 is SLOW

Unfortunately, the "engine" behind the scenes is BLAS, ...READ MORE

May 9, 2018 in Python by charlie_brown
• 7,720 points
1,044 views
0 votes
1 answer

Generate random integers between 0 and 9

Try: from random import randint print(randint(0, 9)) More info: ...READ MORE

Jul 26, 2018 in Python by Priyaj
• 58,090 points
1,040 views
0 votes
0 answers

Please help me to install speech recognition in VS code

I got this type of error ERROR: Could ...READ MORE

Oct 4, 2021 in Python by Edureka
• 120 points
1,039 views
0 votes
1 answer

How can I make an EXE file from a Python program?

Auto PY to EXE - A .py ...READ MORE

Aug 6, 2019 in Python by SDeb
• 13,300 points
1,038 views
0 votes
1 answer

Python program to read the excel file which contains more than 65K records

Hi @Rashmi! I read your code and there ...READ MORE

Feb 9, 2019 in Python by Omkar
• 69,210 points
1,038 views
0 votes
1 answer

'str' object does not support item assignment

In Python, strings are not very mutable ...READ MORE

Feb 22, 2022 in Python by Aditya
• 7,680 points
1,035 views
0 votes
1 answer

How to insert an object at a given index in Python?

Hi, @Roshni, I will explain to you with ...READ MORE

Jun 24, 2020 in Python by Gitika
• 65,910 points
1,034 views
+1 vote
2 answers

Python string formatting: % vs. .format

Using Python format() function is what the ...READ MORE

Apr 11, 2019 in Python by Dasa Ravi
1,034 views
0 votes
1 answer

How to get a list of built in modules in Python?

simply open the python shell and type ...READ MORE

Aug 1, 2019 in Python by Arvind
• 3,040 points
1,033 views
0 votes
1 answer

Error: Name is not defined, It’s not returning a value

Remove main & try or  Use __name__ instead ...READ MORE

Oct 12, 2020 in Python by Gitika
• 65,910 points
1,032 views
0 votes
1 answer

How do I make a delay in Python?

Hahah! Yes, you need to create a ...READ MORE

Jul 4, 2019 in Python by Pooja
1,028 views
0 votes
1 answer

Python Pandas: Create series using list of values

You can do this using series method. Refer ...READ MORE

May 9, 2019 in Python by Yogi
1,027 views
0 votes
1 answer

invalid literal for int() with base 10

In order to solve this problem, one ...READ MORE

Feb 8, 2022 in Python by Soham
• 9,700 points
1,024 views
0 votes
1 answer

Simple prime number generator in Python

There are some problems with your code. You ...READ MORE

Apr 25, 2022 in Python by narikkadan
• 63,420 points
1,023 views
0 votes
1 answer

How do I log a Python error with debug information?

Hii, In most applications, you won't be calling ...READ MORE

May 11, 2020 in Python by Niroj
• 82,880 points
1,022 views
0 votes
1 answer

Hide a window in the constructor immediately after it is created?

Apparently it seems that the code should ...READ MORE

Sep 28, 2018 in Python by Priyaj
• 58,090 points
1,022 views
0 votes
1 answer

How to add a new line in Python?

You can use '\n' for a next ...READ MORE

May 2, 2018 in Python by aayushi
• 750 points
1,021 views
+1 vote
1 answer

How to write the Fibonacci Sequence?

Efficient Pythonic generator of the Fibonacci sequence I ...READ MORE

Aug 21, 2018 in Python by Priyaj
• 58,090 points
1,020 views
0 votes
1 answer

Parse JSON in Python

import json data=json.loads(employee_data) print(data) READ MORE

Apr 26, 2018 in Python by aayushi
• 750 points
1,018 views
0 votes
0 answers

Initialising an array of fixed size in Python

I want to declare an array or ...READ MORE

Aug 11, 2022 in Python by krishna
• 2,820 points
1,017 views