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
516 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
515 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
515 views
0 votes
1 answer

How to randomly select an item from a list?

Use random.choice() import random foo = ['a', 'b', 'c', 'd', ...READ MORE

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

I am unable to import pyttsx2 in python. Python is throwing exception ModuleNotFoundError.

Hey, @Athrava Gulve, Hey, @Atharva, Which version of Python your ...READ MORE

Oct 7, 2020 in Python by Gitika
• 65,910 points
515 views
0 votes
0 answers

name error: name 'symtr' is not globally defined

class Solution(object):     def symtr(self,root1, root2):         if(root1==None and root2==None):             return True         elif(root1==None ...READ MORE

May 14, 2020 in Python by anonymous
• 120 points
514 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
514 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
514 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
514 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
514 views
0 votes
1 answer

datetime.datetime.now() + 1

You can write the code as follows ...READ MORE

Mar 11, 2019 in Python by SDeb
• 13,300 points
513 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
513 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
512 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
512 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
512 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
512 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
512 views
0 votes
0 answers

Numerical_vision_problem [distance_Pixels]

hello everybody, hoping that all with good ...READ MORE

May 2, 2020 in Python by anonymous
• 120 points
511 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
511 views
0 votes
1 answer

What do "init" and "self" do in python ?

In Python, `init` and `self` are related ...READ MORE

Oct 5, 2023 in Python by anonymous
• 3,320 points
510 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
510 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
510 views
0 votes
1 answer

What is the purpose of self?

The reason you need to use self. ...READ MORE

Aug 3, 2018 in Python by Priyaj
• 58,090 points
510 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
509 views
0 votes
1 answer

Build python on mac

Fork the CPython repository to your GitHub account and get ...READ MORE

Jun 6, 2019 in Python by Fez
509 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
509 views
0 votes
0 answers

cannot read a csv file in python

i am getting an error reading a ...READ MORE

Mar 6, 2019 in Python by Mohammad
• 3,230 points
509 views
0 votes
1 answer

How to print without newline or space?

In Python 3, you can use the sep= and end= parameters ...READ MORE

Nov 26, 2020 in Python by Gitika
• 65,910 points
508 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
508 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
508 views
0 votes
1 answer

Base language of Python

Python is written in C, not completely ...READ MORE

Feb 3, 2022 in Python by Dev
• 6,000 points
507 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
507 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
507 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
507 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
506 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
506 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
506 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
506 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
506 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
506 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
505 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
505 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
505 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
505 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
505 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
504 views
0 votes
0 answers

how do sort the columns in a dataframe using the pandas?

can you give an example using dataframe? READ MORE

May 6, 2019 in Python by Waseem
• 4,540 points
504 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
504 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
503 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
503 views