Most viewed questions in Python

0 votes
1 answer

correct use of random.seed() in reading a text file

Hi, @Flygen, Seeding a pseudo-random number generator gives ...READ MORE

Aug 3, 2020 in Python by Gitika
• 65,910 points
1,502 views
0 votes
1 answer

How can I arrange the words in ascending order?

Yes there is a function in python ...READ MORE

Nov 19, 2018 in Python by Nabarupa
1,497 views
+1 vote
1 answer

How to Profile a script in Python

Python includes a profiler called cProfile. It ...READ MORE

Nov 21, 2018 in Python by SDeb
• 13,300 points
1,495 views
+1 vote
1 answer

Using filter() and map() together

You are not providing the parameters in ...READ MORE

Jul 26, 2019 in Python by Wajiha
• 1,950 points
1,490 views
0 votes
0 answers

How to install pywhatkit in python?

if I am going to install pywhatkit ...READ MORE

Apr 22, 2022 in Python by Edureka
• 13,620 points
1,489 views
+1 vote
1 answer

is it possible to compare a values to a backslash in Python?

The backslash "\" character is used to ...READ MORE

Jun 28, 2019 in Python by Neel
• 3,020 points
1,488 views
0 votes
1 answer

Error: IndexError: list index out of range and python

IndexError The IndexError is raised when you attempt to retrieve ...READ MORE

Dec 16, 2020 in Python by Gitika
• 65,910 points
1,487 views
0 votes
4 answers

What is a Tuple in Python and how to use it?

Tuples  are a  Unchanging sequence of values, ...READ MORE

Jun 21, 2020 in Python by sahil
• 580 points
1,487 views
0 votes
1 answer

Crawling after login in Python

You missed a few login data forms, ...READ MORE

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

How to convert a dictionary into a list in python?

Hi@akhtar You can convert a dictionary dataset into ...READ MORE

Jun 25, 2020 in Python by MD
• 95,440 points
1,483 views
0 votes
0 answers

Use inverse transform with deep learning. Conceptual clarity needed

I have built a deep learning model ...READ MORE

Mar 21, 2020 in Python by Anan
• 180 points
1,483 views
0 votes
1 answer

how to find factorial of a number?

You can find factorial by many ways. ...READ MORE

May 4, 2018 in Python by aayushi
• 750 points
1,480 views
0 votes
1 answer

Need help with making use of Pluck in Python

Hi, good question. Easy solution to be ...READ MORE

Jan 24, 2019 in Python by Nymeria
• 3,560 points
1,478 views
0 votes
1 answer

How does the @property decorator work?

The property() function returns a special descriptor object: >>> property() <property object ...READ MORE

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

How can I use Python to get the system hostname?

Hello @Kartik, Use socket and its gethostname() functionality. This will get the hostname of ...READ MORE

Dec 8, 2020 in Python by Niroj
• 82,880 points
1,476 views
0 votes
1 answer

Can't use read() for html2text?

decode() the content with the charset sent inside ...READ MORE

Jul 3, 2019 in Python by SDeb
• 13,300 points
1,476 views
0 votes
1 answer

error while installing pyautoit

Hi @reddy!  According to the Python Documentation, Error code ...READ MORE

Jan 27, 2019 in Python by Omkar
• 69,230 points
1,476 views
0 votes
0 answers

how do i use the XOR operator in python regular expression?

can u give an example? READ MORE

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

"inconsistent use of tabs and spaces in indentation"

To answer your question, start with eliminating ...READ MORE

Feb 10, 2022 in Python by Rahul
• 9,670 points
1,469 views
0 votes
1 answer

How to count the NaN values in a column in pandas DataFrame?

Hello @kartik, Lets assume df is a pandas DataFrame. Then, df.isnull().sum(axis = ...READ MORE

Jun 15, 2020 in Python by Niroj
• 82,880 points
1,469 views
0 votes
2 answers

How to split excel field data which contains the multiple delimiter values?

Try the following: new = data["Filed_data"].str.split(";", n = ...READ MORE

Jun 25, 2020 in Python by Shivam Dutt Sharma
1,468 views
0 votes
1 answer

Access sys.argv as bytes in Python 3

Since on Python 3 sys.argv is encoded ...READ MORE

May 16, 2019 in Python by SDeb
• 13,300 points
1,468 views
0 votes
1 answer

Python script for how much total salary cost has increased

Here you can use groupby() and mean() to get the desired ...READ MORE

Feb 14, 2019 in Python by Umar
1,467 views
0 votes
1 answer

What is the purpose of using lambda functions in Python?

The main purpose of anonymous functions come ...READ MORE

Jun 11, 2019 in Python by Nisa
• 1,090 points
1,464 views
0 votes
1 answer

Real-world examples of applications in python?

You can view this reference here: Python projects ...READ MORE

Nov 2, 2018 in Python by Nabarupa
1,462 views
0 votes
0 answers

Snakemake: how to map input to output without using dynamic() [closed]

I have a pipeline that has a ...READ MORE

Oct 3, 2018 in Python by eatcodesleeprepeat
• 4,710 points

closed Oct 3, 2018 by Priyaj 1,461 views
0 votes
1 answer

How to remove a key from a Python dictionary?

Hello, If you need to remove a lot ...READ MORE

Apr 15, 2020 in Python by Niroj
• 82,880 points
1,460 views
0 votes
1 answer

Python pygame error : Failed loading libpng.dylib: dlopen(libpng.dylib, 2): image not found

Try installing libpng You can do it with ...READ MORE

May 31, 2019 in Python by SDeb
• 13,300 points
1,460 views
0 votes
1 answer

How to write a Python code to sort a numerical dataset?

Hi, @Roshni,  The code to sort a numerical ...READ MORE

Jun 26, 2020 in Python by Gitika
• 65,910 points
1,458 views
0 votes
1 answer

Can somebody explain the output of this code snippet?

By making a copy of a list ...READ MORE

Jun 23, 2020 in Python by Ya Sd
1,458 views
0 votes
1 answer

SKLearn NMF Vs Custom NMF

The choice of the optimizer has a ...READ MORE

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

Run two functions at different times

Please refer the below code for your ...READ MORE

Jul 10, 2019 in Python by Rasheed
1,452 views
0 votes
1 answer

X and Y or Z - ternary operator

According to the docs: The expression x and ...READ MORE

May 23, 2019 in Python by SDeb
• 13,300 points
1,452 views
0 votes
1 answer

How to resolve the typeerror in python os module?

TypeError - because the argument doesn't have ...READ MORE

Jul 31, 2019 in Python by Mohammad
• 3,230 points
1,450 views
0 votes
1 answer

How to zip with a list output in Python instead of a tuple output?

Good question - Considering that you are ...READ MORE

Feb 7, 2019 in Python by Nymeria
• 3,560 points
1,447 views
0 votes
1 answer

How to install biopython module in python?

To install biopython on your project, simply ...READ MORE

Jul 8, 2019 in Python by Mohammad
• 3,230 points
1,446 views
0 votes
0 answers

ValueError: could not broadcast input array from shape (224,224,9) into shape (224,224)

img_shape = 224 test_data = [] test_labels = [] for ...READ MORE

Nov 6, 2020 in Python by Eyosiyas
• 120 points
1,443 views
0 votes
1 answer

Regarding pyc file in Python

When you run a Python script, Python ...READ MORE

Feb 7, 2019 in Python by Yogi
1,442 views
0 votes
1 answer

Django Server Error: port is already in use

Hello @kartik, Just type: sudo fuser -k 8000/tcp. This ...READ MORE

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

ImportError: Environment variable DJANGO_SETTINGS_MODULE is undefined

Hello @kartik, You just need to be able to ...READ MORE

Jun 12, 2020 in Python by Niroj
• 82,880 points
1,438 views
0 votes
2 answers

Python error "pygame.error: Couldn't open pygame.png"

add import os at top of your ...READ MORE

Sep 25, 2020 in Python by anonymous
1,438 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
1,434 views
–1 vote
1 answer

Python change directory error

The syntax of the command you are ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,230 points
1,430 views
0 votes
1 answer

What is the difference between tree depth and height?

To answer your question, you will have ...READ MORE

Feb 9, 2022 in Python by Rahul
• 9,670 points
1,423 views
0 votes
1 answer

I have created python chatbot using flask framework using yml file now i want to use json file what should i do now ?

Hello @golu , Try something like this: with open(yaml_file, 'r') ...READ MORE

Nov 19, 2020 in Python by Niroj
• 82,880 points
1,423 views
0 votes
0 answers

Selenium google chrome not loading until pressing refresh button python

I have a problem which I don't ...READ MORE

May 17, 2019 in Python by A
• 150 points

edited May 17, 2019 by Omkar 1,421 views
0 votes
1 answer

How to convert a list into an array in Python?

Hi@akhtar, You need to import the NumPy module ...READ MORE

Oct 15, 2020 in Python by MD
• 95,440 points
1,420 views
+1 vote
1 answer

Why does print() run only after executing for loop in Python?

Your stdout is line-buffered; this means that it won't ...READ MORE

Aug 1, 2019 in Python by Neel
• 3,020 points
1,418 views
0 votes
1 answer

What is the difference between str() and repr() functions in Python?

str() is mostly used to create output ...READ MORE

Jul 8, 2019 in Python by Arvind
• 3,040 points
1,418 views