Trending questions in Python

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
653 views
0 votes
0 answers

How do I reverse a list or loop over it backwards?

How can I perform a Python reverse ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
600 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
591 views
0 votes
0 answers

Reverse a string in Python

The str object in Python doesn't have ...READ MORE

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

Does Python have a ternary conditional operator?

Is there a ternary conditional operator in ...READ MORE

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

How to sum multiple columns until limit from other column is reached?

I have the following Pyspark dataframe. I ...READ MORE

Sep 27, 2022 in Python by anonymous

edited Mar 4 50 views
0 votes
0 answers

How to take in the first value of a string when multiple are presented?

keyWord = ["urgent", "Linux", ...] val = input("Enter ...READ MORE

Sep 25, 2022 in Python by Edureka

edited Mar 4 50 views
0 votes
0 answers

Java : Sort integer array without using Arrays.sort()

I have this assignment- Write java program ...READ MORE

Aug 2, 2022 in Python by krishna
• 2,820 points
2,384 views
0 votes
0 answers

please help with this

I need the user to type 17 ...READ MORE

Sep 25, 2022 in Python by bonicoder

edited Mar 4 20 views
0 votes
3 answers

Python program to print occurrence of character in string

Try below code string = input("Enter a string: ...READ MORE

May 28, 2020 in Python by Anubhav
• 300 points
31,246 views
0 votes
0 answers

Does Python have a string 'contains' substring method?

I'm trying to find a Python string.contains ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points

edited Mar 4 51 views
0 votes
0 answers

Relative imports in Python 3

In the same directory, I wish to ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points

edited Mar 4 23 views
0 votes
0 answers

What is the meaning of "int(a[::-1])" in Python? [duplicate]

I cannot understand this. I have seen ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points

edited Mar 4 22 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,716 views
0 votes
1 answer

'NoneType' object has no attribute 'text

Hello @Muhammad Umer, As per the Beautiful Soup Documentation: AttributeError: ...READ MORE

Dec 7, 2020 in Python by Niroj
• 82,840 points
28,103 views
0 votes
0 answers

'utf-8' codec can't decode byte 0x93 in position 249: invalid start byte

from chatterbot import ChatBot from chatterbot.trainers import ChatterBotCorpusTrainer chatbot=ChatBot('corona ...READ MORE

Sep 17, 2022 in Python by Jash

edited Mar 4 30 views
0 votes
1 answer

How do I filter query objects by date range in Django?

Hello @kartik, Use Sample.objects.filter(date__range=["2020-01-01", "2020-01-31"]) Or if you are just ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,840 points
34,685 views
0 votes
0 answers

how do I split a large document of 10,000 words into a sub documents which contain 1000 words per each document?

There is text document of 10,000 words....I ...READ MORE

Sep 3, 2022 in Python by rakshita

edited Mar 4 25 views
0 votes
0 answers

Flattening a list of NumPy arrays?

I have data in a list type ...READ MORE

Aug 5, 2022 in Python by krishna
• 2,820 points
1,274 views
0 votes
1 answer

Error:django MultiValueDictKeyError

Hello @kartik, Use the MultiValueDict's get method. This is also ...READ MORE

May 20, 2020 in Python by Niroj
• 82,840 points
36,079 views
0 votes
1 answer

EOFError: EOF when reading a line

The code: width, height = map(int, input().split()) def rectanglePerimeter(width, ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,600 points
5,353 views
0 votes
0 answers

pip3: command not found but python3-pip is already installed

I am not able to use  pip3 ...READ MORE

May 27, 2022 in Python by Kichu
• 19,040 points
4,005 views
0 votes
0 answers

matrix multiplication of arrays in python

I am having trouble finding a solution ...READ MORE

Aug 2, 2022 in Python by krishna
• 2,820 points
1,136 views
0 votes
0 answers

Combined mean and standard deviation from a collection of NumPy arrays of different shapes

Consider that I have a numpy array ...READ MORE

Aug 2, 2022 in Python by krishna
• 2,820 points
1,088 views
0 votes
0 answers

What are the differences between numpy arrays and matrices? Which one should I use?

What are each's advantages and drawbacks? I've noticed ...READ MORE

Aug 8, 2022 in Python by krishna
• 2,820 points
699 views
0 votes
2 answers

How to click button selenium python?

Selenium can automatically click on buttons that ...READ MORE

Oct 14, 2020 in Python by Danish Bhatiya
29,068 views
0 votes
0 answers

Python numpy array of numpy arrays

I have a requirement. I need to ...READ MORE

Aug 1, 2022 in Python by krishna
• 2,820 points
748 views
0 votes
0 answers

Sorting arrays in NumPy by column

How can I sort a numpy array ...READ MORE

Aug 2, 2022 in Python by krishna
• 2,820 points
668 views
0 votes
1 answer

Python pip on Windows - command "cl.exe" failed

You should have  cl.exe (the Microsoft C Compiler) installed ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,600 points
4,733 views
0 votes
0 answers

Concatenate two numpy arrays in the 4th dimension

I got two numpy arrays in three ...READ MORE

Aug 1, 2022 in Python by krishna
• 2,820 points
581 views
0 votes
0 answers

while doing --channel.send('manage show '+raw1+' all a'+"\n") the "all a" taking as 2nd line so getting error

 connected to server using SSH.client and  able ...READ MORE

Aug 12, 2022 in Python by Basavraj

edited Mar 4 44 views
0 votes
3 answers

Python pandas: TypeError: tuple indices must be integers or slices, not str

In fact, I get a perfectly good ...READ MORE

Jun 13, 2019 in Python by Alok
51,244 views
0 votes
0 answers

Python Traceback (most recent call last)

The error message: Traceback (most recent call last): ...READ MORE

May 12, 2022 in Python by Kichu
• 19,040 points
3,501 views
0 votes
0 answers

PermissionError: [Errno 13] Permission denied

This is the code : def download(): ...READ MORE

May 14, 2022 in Python by Kichu
• 19,040 points
3,429 views
0 votes
1 answer

Detect and exclude outliers in a pandas DataFrame

Function definition. This handles data when non-numeric attributes ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,600 points
4,074 views
0 votes
0 answers

OpenCV NoneType object has no attribute shape

I  am working on Raspberry Pi with ...READ MORE

May 9, 2022 in Python by Kichu
• 19,040 points
3,443 views
0 votes
0 answers

Python - TypeError: Object of type 'int64' is not JSON serializable

My data frame has store names and ...READ MORE

May 26, 2022 in Python by Kichu
• 19,040 points
2,676 views
0 votes
3 answers

i am installing wordcloud using pip but i am unable to do that ....i am getting the following error

word cloud is not supported for python ...READ MORE

Apr 15, 2020 in Python by anonymous
33,817 views
0 votes
1 answer

how to solve this IndexError: list index out of range in python and streamlit?

Hi,  @Erick, To solve the “index error: list ...READ MORE

Sep 25, 2020 in Python by Roshni
• 10,480 points
28,698 views
0 votes
1 answer

How to check if list is ascending?

How to write ascding order list READ MORE

Jul 17, 2022 in Python by A, b, g, x, z

edited Mar 5 13,955 views
0 votes
0 answers

Flask ImportError: No Module Named Flask

I followed this flask tutorial: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world. I am getting ...READ MORE

May 23, 2022 in Python by Kichu
• 19,040 points
2,435 views
0 votes
0 answers

actually i am finding the bugs in the code and unable to run the code in python

none = none a = none + 5 ...READ MORE

Jul 19, 2022 in Python by anonymous

edited Mar 4 19 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,882 views
0 votes
0 answers

Constructing pandas DataFrame from values in variables gives "ValueError: If using all scalar values, you must pass an index"

If  I have two variables as follows: a ...READ MORE

May 19, 2022 in Python by Kichu
• 19,040 points
2,407 views
0 votes
0 answers

TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array

I am working on a function that ...READ MORE

May 8, 2022 in Python by Kichu
• 19,040 points
2,827 views
0 votes
3 answers
0 votes
0 answers

why is my syntax error? expected an indented block

class LinearModel():     def __init__(self, features, target):  self.X ...READ MORE

Jul 12, 2022 in Python by Abdulloh

edited Mar 4 19 views