Latest questions in Python

0 votes
0 answers

How to convert YOLO format annotations to x1, y1, x2, y2 coordinates in Python?

I would like to know how to ...READ MORE

May 9, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 105 views
0 votes
0 answers

Extracting extension from filename in Python

Is it possible to extract the extension ...READ MORE

May 9, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 98 views
0 votes
0 answers

Immutable vs Mutable types

I'm confused on what an immutable type ...READ MORE

May 9, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 125 views
0 votes
0 answers

Which version of Python do I have installed?

On a Windows server, I need to ...READ MORE

May 9, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 100 views
0 votes
0 answers

Unable to install pandas for python

I'm attempting to install pandas for Python, ...READ MORE

May 9, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 145 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,040 points
1,879 views
0 votes
0 answers

Conda: Creating a virtual environment

I am trying to create a virtual ...READ MORE

May 9, 2022 in Python by Kichu
• 19,040 points
787 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,864 views
0 votes
0 answers

TypeError: 'int' object is not callable

This is the code : from __future__ import ...READ MORE

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

TypeError: 'int' object is not callable

gfdfghfhg READ MORE

May 8, 2022 in Python by Kichu
• 19,040 points

edited Mar 4 102 views
0 votes
0 answers

How can I prevent the TypeError: list indices must be integers, not tuple when copying a python list to a numpy array?

I want to create 3 numpy arrays/lists ...READ MORE

May 7, 2022 in Python by narikkadan
• 63,600 points
968 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,600 points
2,509 views
0 votes
0 answers

Renaming column names in Pandas

How can  I change the column labels of ...READ MORE

May 5, 2022 in Python by Kichu
• 19,040 points
534 views
0 votes
0 answers

TypeError: 'NoneType' object is not iterable in Python

What does this error mean?  I get this ...READ MORE

May 5, 2022 in Python by Kichu
• 19,040 points
1,945 views
0 votes
0 answers

How can I take a message or command as user input to run a Python code

Is there any way where we can ...READ MORE

May 4, 2022 in Python by Sumana

edited Mar 4 101 views
0 votes
0 answers

Unable to install pandas for python

I am trying to install pandas for ...READ MORE

May 2, 2022 in Python by Edureka
• 12,690 points

edited Mar 4 135 views
0 votes
0 answers

Generate random integers between 0 and 9

How can I generate random integers between ...READ MORE

May 2, 2022 in Python by Edureka
• 12,690 points

edited Mar 4 131 views
0 votes
0 answers

Removing duplicates in lists

How do I get a new list ...READ MORE

May 2, 2022 in Python by Edureka
• 12,690 points

edited Mar 4 131 views
0 votes
0 answers

How do I count the occurrences of a list item?

Given an item, how do I count ...READ MORE

May 2, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 127 views
0 votes
0 answers

Is there a "not equal" operator in Python?

How would you say does not equal? Like if ...READ MORE

May 2, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 103 views
0 votes
0 answers

Static methods in Python?

Is it possible to have static methods ...READ MORE

May 2, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 141 views
0 votes
0 answers

What do these operators mean (** , ^ , %, //)?

Other than the standard +, -, *and / operators; but what does ...READ MORE

May 2, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 140 views
0 votes
0 answers

How to calculate a mod b in Python?

Is there a modulo function in the ...READ MORE

May 2, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 110 views
0 votes
0 answers

What does end=' ' exactly do?

So, I'm struggling trying to understand this ...READ MORE

May 2, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 146 views
0 votes
0 answers

Remove 'b' character do in front of a string literal in Python 3

I am new in python programming and ...READ MORE

May 2, 2022 in Python by Edureka
• 13,630 points

edited Mar 4 119 views
0 votes
0 answers

IndentationError: unindent does not match any outer indentation level

When I compile  my python code I ...READ MORE

May 2, 2022 in Python by Kichu
• 19,040 points
902 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,600 points
2,821 views
0 votes
1 answer

Error: 'int' object is not subscriptable - Python

The issue is in the line: int([x[age1]]) The solution ...READ MORE

Apr 30, 2022 in Python by narikkadan
• 63,600 points
1,749 views
0 votes
0 answers

Switching between Python 3.7 and 3.8 under Anaconda

What is the rationale for having two ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,630 points
658 views
0 votes
0 answers

How do I use method overloading in Python?

I am trying to implement method overloading ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,630 points
716 views
0 votes
1 answer

How to generate all permutations of a list?

This solution implements a generator, to avoid ...READ MORE

May 9, 2022 in Python by Edureka
• 12,690 points

edited Mar 5 1,040 views
0 votes
0 answers

Quicksort with Python

I am totally new to python and ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,630 points
641 views
0 votes
0 answers

Python vs Cpython

What exactly is CPython and how does ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,630 points
565 views
0 votes
0 answers

If in Python I put a list inside a tuple, can I safely change the contents of that list?

The value inside the tuple is simply ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,630 points
587 views
0 votes
0 answers

What does the "yield" keyword do?

What is the use of the yield ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,630 points
424 views
0 votes
0 answers

Function for factorial in Python

How do I go about computing a ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,630 points
583 views
0 votes
1 answer

Is Python strongly typed?

Python is both strongly and dynamically typed. Strongly ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,600 points
1,277 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,600 points
8,023 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,848 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,462 views
0 votes
1 answer

What is the difference between read() and readline() in python?

The read() will read the whole file at ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,600 points
17,725 views
0 votes
1 answer

Error - could not install packages due to an oserror - [errno 2] no such file or directory

I also met with the same problem ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,600 points
41,308 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,600 points
8,966 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,600 points
2,533 views
0 votes
1 answer

How to urlencode a querystring in Python?

Just pass your parameters into urlencode() like: >>> import urllib >>> ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,600 points
779 views
0 votes
1 answer

How do I upgrade the Python installation in Windows 10?

If you have 2.x or 3.x version ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,600 points
673 views
+1 vote
1 answer

Unzipping files in Python

Use this code: import zipfile with zipfile.ZipFile(path_to_zip_file, 'r') as ...READ MORE

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

Spell Checker for Python

This function, in particular, has the ideas ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,600 points
1,177 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,127 views
0 votes
0 answers

Python shopping cart add to cart, get total get num items

I want to loop through the list ...READ MORE

Apr 25, 2022 in Python by Kichu
• 19,040 points
23,783 views