Trending questions in Python

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, 2025 301 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,040 points
2,553 views
0 votes
0 answers

Open Whatsapp Windows app directly from python program using url

According to this FAQ page of Whatsapp on How to ...READ MORE

Apr 18, 2022 in Python by Edureka
• 13,750 points
1,805 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
• 86,360 points
3,150 views
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, 2025 289 views
0 votes
0 answers

ImportError: cannot import name api ,when we try to export swagger specification in python restplus

from flask import json from myapp import api urlvars ...READ MORE

Jul 8, 2022 in Python by Rakshitha

edited Mar 4, 2025 320 views
0 votes
0 answers

Filter data in django before expired date

I want to show and filter  data ...READ MORE

Jul 5, 2022 in Python by Ide

edited Mar 4, 2025 314 views
0 votes
1 answer

How to parse `request.body` from POST in Django?

Hello @kartik, In Python 3.0 to Python 3.5.x, json.loads() will ...READ MORE

Aug 5, 2020 in Python by Niroj
• 82,800 points
30,338 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
• 86,360 points
3,137 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,040 points
1,937 views
0 votes
0 answers

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

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

May 18, 2022 in Python by Kichu
• 19,040 points
2,079 views
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,040 points
2,028 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,040 points
1,787 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,040 points
2,230 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
2,339 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
2,442 views
0 votes
0 answers

I executed this code. But its showing me error. Could anyone fix it?

READ MORE

Jun 25, 2022 in Python by anonymous

edited Mar 4, 2025 304 views
0 votes
0 answers

how to merge two data frames based on particular column in pandas python?

I want to  merge two data frames: df1 company,standard tata,A1 cts,A2 dell,A3 df2 company,return tata,71 dell,78 cts,27 hcl,23 I ...READ MORE

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

Python Requests get returns response code 401 for nse india website

I use this program to get the ...READ MORE

Apr 22, 2022 in Python by Edureka
• 13,750 points
2,996 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,040 points
1,592 views
0 votes
0 answers

lmList, bbox = detector.findPosition(img) ValueError: not enough values to unpack (expected 2, got 0)

can anyone please help me, tried those ...READ MORE

Jun 22, 2022 in Python by Webinar

edited Mar 4, 2025 274 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,040 points
1,169 views
0 votes
1 answer

Distance calculator

#Starting position co-ordinates - x=0 and y=0 import ...READ MORE

May 8, 2023 in Python by GS

edited Mar 5, 2025 5,639 views
0 votes
0 answers

ModuleNotFoundError: No module named 'sklearn'

I am using Anaconda and Python 3.6.1 ...READ MORE

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

'str' object has no attribute 'decode'. Python 3 error?

Code: import imaplib from email.parser import HeaderParser conn = imaplib.IMAP4_SSL('imap.gmail.com') conn.login('example@gmail.com', ...READ MORE

May 13, 2022 in Python by Kichu
• 19,040 points
1,664 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
• 86,360 points
2,229 views
0 votes
0 answers

"getaddrinfo failed", what does that mean?

I am getting this error when launching ...READ MORE

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

Python 3 ImportError: No module named 'ConfigParser'

I want to pip - install the ...READ MORE

Apr 24, 2022 in Python by Kichu
• 19,040 points
2,443 views
0 votes
0 answers

Double the value of array on a match - Python

I want to iterate through the elements ...READ MORE

Apr 24, 2022 in Python by Kichu
• 19,040 points
2,390 views
0 votes
0 answers

Automate logging in to MS form using Python

I have to login into the same ...READ MORE

Apr 22, 2022 in Python by Edureka
• 13,750 points
2,371 views
0 votes
0 answers

How to prettyprint a JSON file?

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

Extract a page from a pdf as a jpeg

How can I  save a certain page ...READ MORE

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

How do I convert a datetime to date?

How do I convert a datetime.datetime object ...READ MORE

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

How can I install XGBoost package in python on Windows

I am using windows 64bit os and ...READ MORE

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

How to highlight cell value in dataframe that exceeds mean of its column

I have a df with where I ...READ MORE

Jun 10, 2022 in Python by Pavan

edited Mar 4, 2025 318 views
0 votes
0 answers

Writing a pandas DataFrame to CSV file

I want to write a pandas data ...READ MORE

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

Why am I getting a FileNotFoundError?

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

May 24, 2022 in Python by Kichu
• 19,040 points
878 views
0 votes
0 answers

How do I do a case-insensitive string comparison?

How can I do case-insensitive string comparison ...READ MORE

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

IndentationError: expected an indented block

this is my code  stemming = PorterStemmer() corpus = ...READ MORE

Jun 8, 2022 in Python by anonymous

edited Mar 4, 2025 289 views
0 votes
0 answers

How do I use matplotlib autopct?

I want to create a matplotlib pie ...READ MORE

Apr 24, 2022 in Python by Kichu
• 19,040 points
2,167 views
0 votes
1 answer

Django object is not JSON serializable

Hello @kartik, simplejson and json don't work with django objects well. Django's ...READ MORE

Aug 7, 2020 in Python by Niroj
• 82,800 points
29,106 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
• 86,360 points
1,481 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
• 86,360 points
1,996 views
0 votes
0 answers

Module 'numpy.core' has no attribute 'numerictypes' (Error)

from imageai.Detection import ObjectDetection detector = ObjectDetection() detector.setModelTypeAsTinyYOLOv3() detector.setModelPath("BrainTumor10EpochsCategorical.h5") detector.loadModel() detection = ...READ MORE

Jun 3, 2022 in Python by Abdullah Celal

edited Mar 4, 2025 309 views
0 votes
1 answer

Got an error while installing opencv-python

instead of writing pip install  'opencv-python ' ...READ MORE

Aug 5, 2022 in Python by Shaikh Amaan

edited Mar 5, 2025 12,263 views
0 votes
0 answers

Python's equivalent of && (logical-and) in an if-statement

This is not  working : if cond1 && cond2: Can ...READ MORE

May 20, 2022 in Python by Kichu
• 19,040 points
778 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
• 86,360 points
1,719 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,720 points

edited Mar 5, 2025 1,447 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
• 86,360 points
1,715 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
1,147 views