Most viewed questions in Python

0 votes
1 answer

Python code to send an email message from 1 email id to another

Hi @Deb, try out the following code: import ...READ MORE

Jun 11, 2019 in Python by Picentra
876 views
0 votes
1 answer

How to rename column in pandas?

You can use the rename option to ...READ MORE

Apr 3, 2019 in Python by Firoz
875 views
0 votes
0 answers

Visualize the full chess board from the library python-chess on line command

I am working a chess game based ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
873 views
0 votes
1 answer

ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

Hello @kartik, The following code works: >>> from django.template ...READ MORE

Aug 7, 2020 in Python by Niroj
• 82,880 points
873 views
0 votes
1 answer

How to use string.replace() in python 3.x

replace() is a method of <class 'str'> ...READ MORE

Aug 3, 2018 in Python by Priyaj
• 58,090 points
873 views
0 votes
1 answer

Error in the Javis Project

what you can do is download the ...READ MORE

Jun 28, 2020 in Python by Shaurya Thapliyal
• 340 points
871 views
0 votes
1 answer

How to transfer multiple lines in a file using python?

Hi@akhtar, I don't know it will help you ...READ MORE

Mar 31, 2020 in Python by MD
• 95,440 points
871 views
0 votes
1 answer

Which is the best IDE for Python For Windows

Python is dynamic language so the IDE ...READ MORE

Oct 10, 2018 in Python by Priyaj
• 58,090 points
870 views
0 votes
2 answers

Clear Screen in Python

pip3 install clear-screen and then: from clear_screen import clea ...READ MORE

Jan 28, 2019 in Python by Zong
870 views
0 votes
1 answer

Python constructors and __init__

There is no function overloading in Python, ...READ MORE

Oct 11, 2018 in Python by SDeb
• 13,300 points
869 views
0 votes
1 answer

python code for fall detection of a video file

Hello @Aruna, You can refer this for your ...READ MORE

Dec 2, 2020 in Python by Niroj
• 82,880 points
868 views
0 votes
1 answer

Install Python on Ubuntu

@Abha you are right about pre-installation of python, ...READ MORE

Mar 1, 2019 in Python by Pratibha
• 3,690 points
867 views
+2 votes
1 answer

How can I record the X,Y limits of a displayed X,Y plot using the matplotlib show() module?

A couple hours after posting this question ...READ MORE

Dec 27, 2018 in Python by anonymous
867 views
0 votes
1 answer

Using filter, map, and reduce in Python

A quick implementation might look like this: from ...READ MORE

Nov 2, 2018 in Python by Priyaj
• 58,090 points
867 views
0 votes
1 answer

How to remove a file using the OS module in Python?

Hi@akhtar, In Python, you can use the os. remove() method to remove ...READ MORE

Oct 18, 2020 in Python by MD
• 95,440 points
866 views
0 votes
1 answer

how to plot a boxplot in python using seaborn?

following is the syntax for a boxplot ...READ MORE

Aug 13, 2019 in Python by Mohammad
• 3,230 points
866 views
0 votes
2 answers

How to add a certain time delay to the code using Python?

You can use time.sleep(duration in second) READ MORE

Feb 14, 2019 in Python by Shashank
• 1,370 points
866 views
0 votes
1 answer

How can I read numbers in Python from a custom file?

Hi, good question. Let us first assume that ...READ MORE

Feb 6, 2019 in Python by Nymeria
• 3,560 points
866 views
0 votes
1 answer

How to create a dictionary whose elements are lists?

A simple way to do this is ...READ MORE

Aug 7, 2019 in Python by Arvind
• 3,040 points
865 views
0 votes
1 answer

When to use %r instead of %s in Python? [duplicate]

The %s specifier converts the object using ...READ MORE

Aug 2, 2018 in Python by bug_seeker
• 15,520 points
865 views
0 votes
1 answer

How can I get list of values from dict?

Here is an example to get the ...READ MORE

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

heapify returns NoneType

The heapify() method transforms the list in-place. This means ...READ MORE

Jul 26, 2019 in Python by SDeb
• 13,300 points
860 views
0 votes
1 answer

Python code to send an email message from my gmail to many others

Hey @Varsha, you can try out the ...READ MORE

Jun 11, 2019 in Python by Travis
860 views
0 votes
0 answers

avro schema validation with shuffled columns

I want to validate my incoming Avro ...READ MORE

Aug 22, 2020 in Python by khyati
• 190 points
859 views
0 votes
2 answers

How to define a class in python?

Class use the special word  class for declaration. ...READ MORE

Jun 6, 2020 in Python by anonymous
• 580 points
858 views
0 votes
1 answer

How to print only the line which starts with P?

Hi, you might have found another way ...READ MORE

Dec 2, 2020 in Python by Tyler
• 140 points
856 views
0 votes
2 answers

argparse argument order

Using Pisa will serve your needs.. READ MORE

Feb 28, 2019 in Python by Pratosh kumar
856 views
0 votes
1 answer

Reading powershell clixml in python

PowerShell's Extended Type System supports auxiliary properties ...READ MORE

Sep 21, 2018 in Python by charlie_brown
• 7,720 points
856 views
0 votes
1 answer

I've been trying to run this code, but the error says "Expected an indented block" for the line, " word_as_list[index] = guess."

Hi, @Paradox, The error message IndentationError: expected an indented ...READ MORE

Nov 21, 2020 in Python by anonymous
• 65,910 points
854 views
0 votes
1 answer

Polynomials in Python

You can easily find polynomials of any ...READ MORE

Aug 27, 2019 in Python by Wajiha
• 1,950 points
854 views
0 votes
1 answer

How can I build a recursive function in python?

I'm wondering whether you meant "recursive". Here ...READ MORE

Sep 19, 2018 in Python by Priyaj
• 58,090 points
854 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
853 views
0 votes
1 answer

Embed R code in python

You can try this : from rpy import ...READ MORE

Feb 11, 2019 in Python by SDeb
• 13,300 points
853 views
0 votes
1 answer

Error like “Your CPU not supported AVX , AVX2”

Your CPU is supported, Only the Binary was ...READ MORE

Oct 14, 2020 in Python by anonymous
• 65,910 points
852 views
0 votes
1 answer

How to allow users to change their own passwords in Django?

Hello @kartik, See the Changing passwords section Navigation to your project ...READ MORE

Aug 17, 2020 in Python by Niroj
• 82,880 points
851 views
0 votes
1 answer

Web scraping problem

This is because many websites do not ...READ MORE

Jul 31, 2019 in Python by Wajiha
• 1,950 points
850 views
0 votes
1 answer

Undefined Behaviour in Python

Python evaluates expressions from left to right. ...READ MORE

Jul 15, 2019 in Python by SDeb
• 13,300 points
850 views
0 votes
1 answer

I'm working on a Summer dataset for practice in Python. However I get the below error:

Hi@Pratap, I think to find duplicate values using ...READ MORE

Jun 15, 2020 in Python by MD
• 95,440 points
847 views
0 votes
1 answer

Python Regex Search And Replace

You need not use a regex. Your ...READ MORE

May 20, 2019 in Python by SDeb
• 13,300 points
847 views
0 votes
1 answer

How to remove blank spaces from Python string?

You can use the strip method to do ...READ MORE

Apr 4, 2019 in Python by Rishi
846 views
0 votes
1 answer

Error:Warning:config file server.conf not found

Hello @kartik, By default, informational and debugging messages ...READ MORE

Jun 22, 2020 in Python by Niroj
• 82,880 points
845 views
0 votes
1 answer

I have trained a model using machine learning algorithm in python , now i want to create a browser extension of that saved model , Is it possible ??

Hi@Shubham, It may possible. When you saved your ML ...READ MORE

Jun 13, 2020 in Python by MD
• 95,440 points
845 views
0 votes
1 answer

How to import a module given its name as string?

With Python older than 2.7/3.1, that's pretty ...READ MORE

Nov 25, 2020 in Python by Gitika
• 65,910 points
844 views
0 votes
1 answer

How do I clone a Django model instance object and save it to the database?

Hello @kartik, Just change the primary key of ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,880 points
843 views
0 votes
1 answer

How do I convert type of an array in python?

Use the following command to change the ...READ MORE

May 24, 2019 in Python by Kishore
843 views
0 votes
1 answer

ImportError: openpyxl is required for loading excel format files

Forget the PsychoPy complications for the time ...READ MORE

Oct 3, 2018 in Python by Priyaj
• 58,090 points
843 views
0 votes
3 answers

How can I sort a dictionary by key in python?

Another way could be: color_dict = {'red':'#FF0000',           'green':'#008000',           'black':'#000000',           'white':'#FFFFFF'} for ...READ MORE

Dec 28, 2020 in Python by Thomas Walenta
841 views
0 votes
1 answer

How to filter Pandas DataFrame by values of columns?

Hi@akhtar, You can filter Pandas Dataframe with the ...READ MORE

Oct 20, 2020 in Python by MD
• 95,440 points
841 views
0 votes
0 answers

Uploading JSON file to a new column in DynamoDB table.

Actually I have two dynamo db tables ...READ MORE

Mar 6, 2020 in Python by Naveena
841 views