Most viewed questions in Python

0 votes
1 answer

How can I go about using var == False in Python?

Hi. Simple answer.  All you need to do ...READ MORE

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

What does hash do in python?

A hash is an fixed sized integer ...READ MORE

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

Call a shell command in Python?

Try this - os.system("commands and arguments") READ MORE

Jun 21, 2018 in Python by Hamartia's Mask
• 1,580 points
506 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
505 views
0 votes
0 answers

How do you install spyder on anaconda?

Is there a way to work with ...READ MORE

Jul 24, 2019 in Python by Waseem
• 4,540 points
505 views
0 votes
1 answer

Tried setting up Django-shop on my system, but when I try to run pipenv install , I get this:404 Snippet not found

Uninstall all python first then install python ...READ MORE

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

How do i install numpy on windows?

Python Package Index (PyPI) is a repository ...READ MORE

Jul 3, 2019 in Python by anonymous
504 views
0 votes
1 answer

PEP8 E226 recommendation

The maintainers of the PEP8 tool decide ...READ MORE

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

% operator in Python

When you use '(%g,%g)', it is the ...READ MORE

Nov 12, 2018 in Python by ana1504.k
• 7,910 points
504 views
0 votes
1 answer

Removing duplicates in lists

To remove duplicates from List use, set ...READ MORE

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

Reverse a string in Python

You should try to use the following ...READ MORE

Feb 8, 2022 in Python by Rahul
• 9,670 points
503 views
0 votes
1 answer

Array values in Python

You can use the enumerate function and ...READ MORE

Nov 28, 2018 in Python by SDeb
• 13,300 points
503 views
0 votes
1 answer

How do you append to a file in Python?

with open("test.txt", "a") as myfile: ...READ MORE

Dec 20, 2020 in Python by Gitika
• 65,910 points
502 views
0 votes
1 answer

How to create one Pytest program?

Hi@akhtar, You need to create a file named test_*.py and ...READ MORE

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

How to set colume as index in Pandas DataFrame?

Hi@akhtar, You can use set_index function in pandas. ...READ MORE

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

Access the sole element of a set

Use set.pop: >>> {1}.pop() 1 >>> In your case, it would be: return ...READ MORE

Jun 28, 2019 in Python by SDeb
• 13,300 points
502 views
0 votes
1 answer

What is the most recent version of python 3?

Python 3.7.3 is the latest release of ...READ MORE

Jun 7, 2019 in Python by Harsh
• 180 points
502 views
0 votes
1 answer

How to use for loop in Python?

There are multiple ways of using for ...READ MORE

Mar 4, 2019 in Python by Priyaj
• 58,090 points
502 views
0 votes
1 answer

Pointers in Python?

I want form.data['field'] and form.field.value to always have the same value This ...READ MORE

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

Compare dates

>>> from datetime import datetime >>> past = ...READ MORE

Jun 14, 2018 in Python by Hamartia's Mask
• 1,580 points
502 views
0 votes
1 answer

What is the easiest way to remove all packages installed by pip?

I've found this snippet as an alternative ...READ MORE

Dec 4, 2020 in Python by Gitika
• 65,910 points
501 views
0 votes
1 answer

I want to install checker package using pip for my code because it shows no reference in my webapp code.

Hi@Rahul, You are trying to use configparser module. ...READ MORE

Jul 7, 2020 in Python by MD
• 95,440 points
501 views
0 votes
0 answers

Can not fetch data from Google fire store

i have https domain with django platfrom ...READ MORE

Nov 18, 2019 in Python by anonymous
• 120 points
501 views
0 votes
1 answer

Get the Current time in Python

To get the current date and time ...READ MORE

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

Mypy with dynamic typing example

Have a look at this example that ...READ MORE

Jun 7, 2019 in Python by Althia
500 views
0 votes
1 answer

Single line Webserver in Python

It is pretty difficult to have a ...READ MORE

Dec 3, 2018 in Python by SDeb
• 13,300 points
500 views
0 votes
1 answer

Deleting a list element by index

Use the del() function del a[2] Or you can ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
500 views
0 votes
1 answer

How to append new data in pandas DataFrame?

Hi@MD, You can use the append function to ...READ MORE

Jun 23, 2020 in Python by akhtar
• 38,230 points
499 views
0 votes
1 answer

Importing across a python package

Placing the imports in __init__.py would be ...READ MORE

Jun 3, 2019 in Python by SDeb
• 13,300 points
499 views
0 votes
1 answer

Python - Use unique element from a set

The best way to achieve this by ...READ MORE

Mar 27, 2019 in Python by Mugdha
• 600 points
499 views
0 votes
1 answer

setuptools: build shared libary from C++ code, then build Cython wrapper linked to shared libary

There is a seemingly undocumented feature of setup that ...READ MORE

Sep 11, 2018 in Python by Priyaj
• 58,090 points
499 views
0 votes
1 answer

How do I check whether a file exists without exceptions?

 It's safer to use a try around the attempt ...READ MORE

Dec 16, 2020 in Python by Gitika
• 65,910 points
498 views
0 votes
1 answer

How to capitalize the first word of string?

Refer to the below command: txt = "hello" x = ...READ MORE

Apr 4, 2019 in Python by Giri
498 views
0 votes
1 answer

What are the key features of Python?

If it makes for an introductory language ...READ MORE

Jul 20, 2018 in Python by Priyaj
• 58,090 points
498 views
0 votes
1 answer

Convert floating point number to a certain precision

With Python < 3 (e.g. 2.6 [see ...READ MORE

Oct 18, 2018 in Python by SDeb
• 13,300 points
497 views
+2 votes
0 answers

unsupported operand type error

tech_list=closingdata.pct_change() tech_list READ MORE

Jan 26, 2020 in Python by Anupriya
• 140 points
496 views
0 votes
1 answer

Information about functions or classes in Python

Information about functions, classes, modules, etc can ...READ MORE

Jun 13, 2019 in Python by Nisa
• 1,090 points
496 views
0 votes
1 answer

What are the differences between type() and isinstance()?

To summarize the contents of other (already ...READ MORE

Jun 4, 2018 in Python by aryya
• 7,450 points
496 views
0 votes
2 answers

Splitting a Python String

The split() method in Python returns a ...READ MORE

Oct 3, 2018 in Python by anonymous
496 views
0 votes
1 answer

How can I count the occurrences of a list item?

If you only want one item's count, ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,910 points
495 views
0 votes
1 answer

How to make a flat list out of list of lists?

Hii @kartik, Given a list of lists l, flat_list = ...READ MORE

Apr 13, 2020 in Python by Niroj
• 82,880 points
495 views
0 votes
1 answer

Can I blindly jump into using docker in production?

Hey Jasmine If the question was can I ...READ MORE

Jul 23, 2019 in Python by Alia
495 views
0 votes
1 answer

Combine selector conditions

In a nutshell, you can do: A[:, range(3) ...READ MORE

Jun 19, 2019 in Python by SDeb
• 13,300 points
495 views
+1 vote
0 answers

How to make python selenium program to perform certain actions depending upon the web interface response?

Hi All, I am trying to download files ...READ MORE

Nov 17, 2019 in Python by varunanand
• 130 points
494 views
0 votes
1 answer

What are the key differences between python and java?

There are a lot of pressing  topics ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
494 views
0 votes
1 answer

A basic question about “while true”

while True means loop forever. The while ...READ MORE

Aug 8, 2018 in Python by bug_seeker
• 15,520 points
494 views
0 votes
0 answers

JSON parsing in python using JSONPath

In the JSON below, I want to ...READ MORE

Apr 19, 2022 in Python by Edureka
• 13,620 points
493 views
0 votes
1 answer

Accessing the index in 'for' loops?

Use enumerate to get the index with ...READ MORE

Mar 13, 2019 in Python by Trisha
493 views
0 votes
1 answer

Reverse a string in Python

>>> 'hello world'[::-1] 'dlrow olleh' This is extended slice syntax. Syntax is ...READ MORE

Nov 16, 2018 in Python by findingbugs
• 3,260 points
493 views
0 votes
1 answer

Run Unix command within Python

From the python docs, use the subprocess ...READ MORE

Apr 27, 2018 in Python by Nietzsche's daemon
• 4,260 points
493 views