Trending questions in Python

0 votes
0 answers

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

I don't get this at all. In ...READ MORE

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

How do I sort a dictionary by value?

I have some dictionary of values that ...READ MORE

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

Does Python have a ternary conditional operator?

Is there a ternary conditional operator in Python? READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
291 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
204 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
1,780 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
996 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
811 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,050 points
3,622 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
431 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,880 points
26,640 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
551 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
546 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,880 points
35,084 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
348 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
298 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
292 views
0 votes
1 answer

How to install modules in Pycharm?

You can install modules in PyCharm using ...READ MORE

May 30, 2019 in Python by Shabnam
• 930 points
50,306 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,420 points
4,296 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,880 points
33,017 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,050 points
3,116 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
27,928 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,050 points
2,949 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,420 points
3,525 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,050 points
2,152 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,050 points
2,788 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,050 points
2,053 views
0 votes
0 answers

Find the minimum strength someone must have in the beginning so that he can cross N cells (Interview question)

Problem Statement: Mustafa wants to cross a dungeon. ...READ MORE

May 26, 2022 in Python by Kichu
• 19,050 points
1,889 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,420 points
3,099 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,520 points
27,995 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,050 points
1,949 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,050 points
2,330 views
0 votes
0 answers

iloc giving 'IndexError: single positional indexer is out-of-bounds'

I was trying to encode some information ...READ MORE

May 23, 2022 in Python by Kichu
• 19,050 points
1,326 views
0 votes
0 answers

Relative imports - ModuleNotFoundError: No module named x

I have these  two files: test.py config.py These are the following ...READ MORE

May 23, 2022 in Python by Kichu
• 19,050 points
1,313 views
0 votes
0 answers

dlib installation on Windows 10

 I have the python app running great ...READ MORE

May 24, 2022 in Python by Kichu
• 19,050 points
1,115 views
0 votes
2 answers

Python Error: No python at 'C:\Users\dell\Appdata\Local\Programs\Python\Python37-32\python.exe'

did you solve this problem? i have ...READ MORE

Aug 20, 2020 in Python by anonymous
29,960 views
0 votes
0 answers

TypeError: 'type' object is not subscriptable when indexing in to a dictionary

I use dict to shorten things as ...READ MORE

May 24, 2022 in Python by Kichu
• 19,050 points
1,108 views
0 votes
3 answers
0 votes
0 answers

No acceptable C compiler found in $PATH when installing python

I followed this post to install a ...READ MORE

May 19, 2022 in Python by Kichu
• 19,050 points
1,255 views
0 votes
0 answers

ImportError: No module named pip

I installed setuptools 1.0 with ez_setup.py from https://pypi.python.org/pypi/setuptools. Then ...READ MORE

May 12, 2022 in Python by Kichu
• 19,050 points
1,530 views
0 votes
0 answers

re.sub erroring with "Expected string or bytes-like object"

I tried looping through my function but ...READ MORE

May 7, 2022 in Python by narikkadan
• 63,420 points
1,735 views
0 votes
0 answers

Error in Python script "Expected 2D array, got 1D array instead:"?

I wanted to make this ML prediction ...READ MORE

May 18, 2022 in Python by Kichu
• 19,050 points
1,218 views
0 votes
1 answer

ValueError: setting an array element with a sequence

The problem is the shape of the ...READ MORE

May 1, 2022 in Python by narikkadan
• 63,420 points
1,957 views
0 votes
0 answers

Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()

 I am getting this error: Truth value of ...READ MORE

May 9, 2022 in Python by Kichu
• 19,050 points
1,594 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
31,868 views
0 votes
0 answers

How to input matrix (2D list) in Python?

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

May 24, 2022 in Python by Kichu
• 19,050 points
845 views
0 votes
1 answer

mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported

Hi@akhtar, According to SQL documentation for python library. you ...READ MORE

Jul 15, 2020 in Python by MD
• 95,440 points
29,920 views
0 votes
0 answers

How do I access environment variables in Python?

May 26, 2022 in Python by Kichu
• 19,050 points
549 views
0 votes
1 answer

Plot correlation matrix using pandas

Just use pyplot.matshow() from matplotlib: import matplotlib.pyplot as plt plt.matshow(dataframe.corr()) plt.show() If df.corr() ...READ MORE

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

memory error in python

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

May 26, 2022 in Python by Kichu
• 19,050 points
522 views