Most viewed questions in Python

0 votes
1 answer

Can't import scikit -learn on python3.

Hi@akhtar, First, remove the Sklearn form your Windows system ...READ MORE

Jun 23, 2020 in Python by MD
• 95,440 points
6,734 views
0 votes
1 answer

Error:setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Hello @kartik, Try installing these packages. sudo apt-get install ...READ MORE

Jun 5, 2020 in Python by Niroj
• 82,880 points
6,728 views
0 votes
1 answer

BeautifulSoup: Not able to extract multiple tags in a class

You are missing the square braces. You ...READ MORE

Apr 2, 2019 in Python by Firoz
6,711 views
0 votes
1 answer

Can I configure Django runserver to reload when static or non-python files are changed?

There is no need to reload server, ...READ MORE

Sep 4, 2018 in Python by Priyaj
• 58,090 points
6,711 views
0 votes
1 answer

How to check if a float value(decimal number) is between range(0 to 10) in python

Hello,  A function that returns True for an integer number (int or ...READ MORE

Sep 14, 2020 in Python by Niroj
• 82,880 points
6,706 views
0 votes
1 answer

flush parameter of print in Python

Usually all I/Os are buffered, meaning they ...READ MORE

Jul 30, 2019 in Python by Wajiha
• 1,950 points
6,670 views
0 votes
1 answer

How to pass query string in url using python requests?

You can pass the key-value pairs to ...READ MORE

May 14, 2019 in Python by Likith
6,630 views
0 votes
1 answer

How to fill Null/NaN values in Pandas Dataframe?

Pandas allows you to change all the ...READ MORE

May 13, 2019 in Python by Rajat
6,618 views
+3 votes
1 answer

Tensorflow 1.5 ImportError: No module named tensorflow.python.client

I think it's a bug in Tensorflow ...READ MORE

Sep 25, 2018 in Python by charlie_brown
• 7,720 points
6,593 views
0 votes
1 answer

How to combine two or more querysets in a Django view?

Hello @kartik, Concatenating the querysets into a list ...READ MORE

Aug 3, 2020 in Python by Niroj
• 82,880 points
6,590 views
0 votes
1 answer

Python: TypeError :Cannot cast Index to dtype int

Try to use numpy  and use .astype(np,int) ...READ MORE

Jun 25, 2020 in Python by Sirajul
• 59,230 points
6,565 views
+1 vote
2 answers

Python convert extracted excel file to csv

Some services require table data in CSV ...READ MORE

Aug 30, 2019 in Python by Mian Tanzeel
6,562 views
0 votes
1 answer

What is the difference between list and tuple?

Lists are mutable(values can be changed) whereas ...READ MORE

May 5, 2018 in Python by aayushi
• 750 points
6,553 views
0 votes
1 answer

How to update Django session variable in javascript?

Hello @kartik, You can do this via Ajax. ...READ MORE

Jul 30, 2020 in Python by Niroj
• 82,880 points
6,539 views
0 votes
1 answer

Python error "AttributeError: '_Screen' object has no attribute 'mainloop'" python module turtle

Hey @Nagya, replace  wn.mainlopp() with turtle.mainloop() ...READ MORE

Jun 19, 2019 in Python by Faiza
6,539 views
0 votes
1 answer

Python Error: ModuleNotFoundError: No module named '<moduleName>'

Python3 and pip are most likely pointing ...READ MORE

Nov 22, 2020 in Python by Gitika
• 65,910 points
6,537 views
0 votes
1 answer

python error " r = sr.Recognizer() AttributeError: 'module' object has no attribute 'Recognizer'"

Hey @Hannh, I had a similar issue. ...READ MORE

Oct 3, 2019 in Python by Farheen
6,535 views
0 votes
1 answer

Error:Unresolved reference 'django' error in PyCharm

Hello @kartik, I assume you're using a virtualenv ...READ MORE

Jul 2, 2020 in Python by Niroj
• 82,880 points
6,533 views
0 votes
1 answer

How to easily install python ldap in linux?

python-ldap provides an object-oriented API to access LDAP directory ...READ MORE

Sep 16, 2019 in Python by Neel
• 3,020 points
6,529 views
0 votes
1 answer

How to convert pandas dataframe to numpy array?

Irrespective of whether the dataframe has similar ...READ MORE

May 13, 2019 in Python by Rishi
6,522 views
0 votes
1 answer

How can I reformat value_counts() analysis in Pandas for large number of columns?

If I were you, I'd do it ...READ MORE

Apr 17, 2018 in Python by anonymous
6,464 views
0 votes
1 answer

What is the difference between print and pprint in Python?

As per the documentation,  The pprint module provides a capability ...READ MORE

Jul 8, 2019 in Python by Arvind
• 3,040 points
6,421 views
0 votes
1 answer

Error:Traceback (most recent call last): File "< stdin >", line 1, in ImportError: cannot import name 'path'

Hello @kartik, You need Django version 2 pip install ...READ MORE

Aug 5, 2020 in Python by Niroj
• 82,880 points
6,409 views
0 votes
1 answer

Python Pandas: Find length of string in dataframe

You can find the length of the ...READ MORE

May 14, 2019 in Python by Firoz
6,399 views
–1 vote
1 answer

Python error saying "NameError: name 'email' is not defined"

you need to define the variable email READ MORE

Nov 29, 2019 in Python by Casper
• 160 points
6,386 views
+1 vote
1 answer

How to install django in anaconda prompt?

Here are the steps that you can ...READ MORE

Jun 23, 2020 in Python by Sirajul
• 59,230 points
6,382 views
0 votes
1 answer

How can I return HTTP status code 204 from a Django view?

Hello, Try this: return HttpResponse(status=204) Hope it works!! ...READ MORE

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

Python code for printing the string without vowels using list comprehension

Hey @Anvit, you can use something like ...READ MORE

Jul 8, 2019 in Python by Rajeev
6,377 views
0 votes
1 answer

Error:Reverse accessor for 'Analysis.assign_user' clashes with reverse accessor for 'Inquiry.assign_user'.

Hello @kartik, The related_name would ensure that the fields were ...READ MORE

Jun 30, 2020 in Python by Niroj
• 82,880 points
6,370 views
0 votes
1 answer

ModuleNotFoundError: No module named 'turtle'

Hi@akhtar, It seems you don't have the turtle ...READ MORE

Jun 26, 2020 in Python by MD
• 95,440 points
6,340 views
0 votes
1 answer

How to get all related Django model objects in Python?

This actually gives you the property names ...READ MORE

Nov 14, 2018 in Python by Nymeria
• 3,560 points

edited Dec 18, 2018 by Nymeria 6,340 views
0 votes
1 answer

Plot a pie-chart in Python in Matplotlib

Not sure which dataset you are using. ...READ MORE

Jul 22, 2019 in Python by Shri
6,296 views
0 votes
1 answer

Python error "ImportError: No module named pygame.locals"

You need to download and install the ...READ MORE

Jun 18, 2019 in Python by Greg
6,270 views
0 votes
1 answer

How to find the value of a row in a csv file in python and print column and row of that value ?

Hello @Khanhh , Use panda to find the value of ...READ MORE

Oct 15, 2020 in Python by Niroj
• 82,880 points
6,266 views
0 votes
1 answer

Difference between a normal def defined function and lambda function in python?

Have a look at this code: # Python ...READ MORE

May 20, 2019 in Python by Trisha
6,258 views
0 votes
1 answer

How to convert string into epoch time?

you are passing the parsed datetime object to ...READ MORE

Sep 22, 2018 in Python by SDeb
• 13,300 points
6,245 views
+1 vote
3 answers

AttributeError: 'module' object has no attribute 'listen"

You'll have to install the pyaudio module ...READ MORE

Oct 3, 2019 in Python by Liala
6,213 views
0 votes
1 answer

How to check if a value exists in pandas dataframe index?

Hello @kartik, Basically instead of raising exception I ...READ MORE

Jun 15, 2020 in Python by Niroj
• 82,880 points
6,209 views
+2 votes
1 answer

“OSError: Unable to open file (bad superblock version number)" in python h5py file read

File could indeed be opened on Linux ...READ MORE

Sep 26, 2018 in Python by Priyaj
• 58,090 points
6,175 views
0 votes
1 answer

How to choose the value and label from Django ModelChoiceField queryset?

Hello @kartik, In your Person model add: def __unicode__(self): ...READ MORE

Jul 29, 2020 in Python by Niroj
• 82,880 points
6,172 views
0 votes
1 answer

Command 'pip' not found

Seems like python is installed in your ...READ MORE

Jan 30, 2019 in Python by Omkar
• 69,210 points
6,155 views
0 votes
1 answer

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

Assumming a is a string. The Slice ...READ MORE

Aug 27, 2018 in Python by Priyaj
• 58,090 points
6,152 views
0 votes
1 answer

What is the inverse operation of np.log() and np.diff()?

Hello @kartik, The reverse will involve taking the ...READ MORE

Jun 16, 2020 in Python by Niroj
• 82,880 points
6,147 views
0 votes
1 answer

Error:urllib and “SSL: CERTIFICATE_VERIFY_FAILED”

Hello @kartik, Insert this code at the beginning ...READ MORE

Jun 5, 2020 in Python by Niroj
• 82,880 points
6,127 views
0 votes
1 answer

AttributeError: 'numpy.ndarray' object has no attribute 'append'

Hi@Nilesh, You have created two empty lists. And ...READ MORE

Aug 11, 2020 in Python by MD
• 95,440 points
6,122 views
0 votes
1 answer

How to get the multiplication table of any number using list comprehension?

Hey @Neha, you can use something like ...READ MORE

Jul 8, 2019 in Python by Sakshi
6,112 views
0 votes
1 answer

input() vs sys.stdin.read()

If you're on Windows, you'll notice that ...READ MORE

Jul 23, 2019 in Python by SDeb
• 13,300 points
6,110 views
0 votes
1 answer

How to get all anchor tags using BeautifulSoup?

Yes, you can do it by using ...READ MORE

Apr 2, 2019 in Python by Kailash
6,087 views
+3 votes
2 answers

What does Python _init_ and self do?

Hey @Anirudh!  Self The self keyword is used to access ...READ MORE

Oct 31, 2018 in Python by Omkar
• 69,210 points
6,087 views
0 votes
1 answer

How to fit a histogram using Python?

Here is an example working on py2.6 ...READ MORE

Dec 26, 2018 in Python by Nymeria
• 3,560 points
6,076 views