Trending questions in Python

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,050 points
921 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,050 points
1,710 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,050 points
1,230 views
0 votes
0 answers

How to prettyprint a JSON file?

May 27, 2022 in Python by Kichu
• 19,050 points
263 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,050 points
239 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,050 points
474 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,050 points
204 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,050 points
236 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,420 points
1,342 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,050 points
230 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,050 points
312 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
48,281 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,050 points
705 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,050 points
252 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,050 points
1,509 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,050 points
351 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,050 points
1,360 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,433 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,050 points
184 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,420 points
593 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,620 points
1,183 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
• 63,420 points
990 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,050 points
465 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,620 points
1,118 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,050 points
389 views
0 votes
1 answer

ln (Natural Log) in Python

Use math.log it is a natural logarithm. For ...READ MORE

Apr 25, 2022 in Python by narikkadan
• 63,420 points
776 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,420 points
676 views
0 votes
0 answers

Why does "pip install" inside Python raise a SyntaxError?

I wanted to use pip to install ...READ MORE

Apr 24, 2022 in Python by Kichu
• 19,050 points
777 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,420 points
650 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,050 points
389 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,050 points
217 views
0 votes
1 answer

Programmatically generate video or animated GIF in Python?

You can use  ImageMagick. Save your frames ...READ MORE

Apr 25, 2022 in Python by narikkadan
• 63,420 points
573 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,420 points
406 views
0 votes
0 answers

How to generate all permutations of a list?

How do you generate all the permutations ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,620 points
437 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,420 points
355 views
0 votes
1 answer

Unsupported operand type(s) for +: 'int' and 'str'

You seem to be trying to train ...READ MORE

Feb 23, 2022 in Python by Aditya
• 7,680 points
3,005 views
0 votes
0 answers

Print multiple arguments in Python

This is my code: print("Total score for %s ...READ MORE

Apr 25, 2022 in Python by Kichu
• 19,050 points
424 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,880 points
27,453 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,620 points
664 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,620 points
306 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,620 points
306 views
0 votes
1 answer

What does "SyntaxError: Missing parentheses in call to 'print'" mean in Python?

This error is generated when one is ...READ MORE

Feb 14, 2022 in Python by Nandini
• 5,480 points
3,319 views
0 votes
1 answer

Parse date string and change format

Use datetime module. it can help you change the ...READ MORE

Apr 25, 2022 in Python by narikkadan
• 63,420 points
298 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,620 points
282 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,420 points
209 views
0 votes
0 answers

Print series of prime numbers in python

I want to print a series of ...READ MORE

Apr 25, 2022 in Python by Kichu
• 19,050 points
329 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,620 points
269 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,620 points
256 views
0 votes
0 answers

Why do I get "List index out of range" when trying to add consecutive numbers in a list using "for i in list"?

Given the following list a = [0, 1, ...READ MORE

Apr 24, 2022 in Python by Kichu
• 19,050 points
315 views
0 votes
0 answers

How to know which Python is running in Jupyter notebook?

I am using jupyter notebook and I ...READ MORE

Apr 24, 2022 in Python by Kichu
• 19,050 points
307 views