Most viewed questions in Python

0 votes
1 answer

Does Python's time.time() return the local or UTC timestamp?

The time.time() function returns the number of seconds since ...READ MORE

Oct 5, 2018 in Python by SDeb
• 13,300 points
850 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
849 views
+1 vote
1 answer

Error in git and python command

The answer to your first problem is ...READ MORE

Jul 4, 2019 in Python by Simran
849 views
+1 vote
1 answer

Implement Quicksort in Python

This will help you. def sort(array=[2,5,1,6,9,8,7,10,21,12]): ...READ MORE

Oct 30, 2018 in Python by Priyaj
• 58,090 points
848 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
847 views
0 votes
1 answer

How do I check if a list is empty in python?

Hey @Vedant, that's pretty simple and straightforward: if ...READ MORE

May 28, 2019 in Python by Karthik
847 views
0 votes
1 answer

Doubt in numpy.vstack

The vstack function in numpy will stack ...READ MORE

Jul 30, 2019 in Python by Esha
844 views
0 votes
1 answer

Is there a way to run Python on Android?

YES! An example via Matt Cutts via SL4A -- "here’s ...READ MORE

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

How can I print an Error in Python?

For Python 2.6 and later and Python ...READ MORE

Oct 12, 2018 in Python by aryya
• 7,450 points
840 views
0 votes
1 answer

Iterating over dictionaries using 'for' loops

key is just a variable name. for key ...READ MORE

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

Size of an object in Python

Use sys.getsizeof() function: >>> import sys >>> s = ...READ MORE

May 25, 2018 in Python by Nietzsche's daemon
• 4,260 points
839 views
0 votes
1 answer

Why Django modeltranslation too many feilds

You can use the below link to ...READ MORE

Oct 1, 2018 in Python by Priyaj
• 58,090 points
837 views
0 votes
1 answer

What is the use of “assert” keyword in Python?

You can try the following in a ...READ MORE

Oct 15, 2018 in Python by Priyaj
• 58,090 points
832 views
0 votes
1 answer

How to add to the python path in Windows?

You know what has worked for me ...READ MORE

Jul 25, 2018 in Python by Frankie
• 9,830 points
832 views
0 votes
0 answers

Flattening a list of NumPy arrays?

I have data in a list type ...READ MORE

Aug 5, 2022 in Python by krishna
• 2,820 points
831 views
0 votes
1 answer

'python' is not recognized as an internal or external command

Use "py" instead of "python" from command ...READ MORE

Feb 16, 2022 in Python by CoolCoder
• 4,400 points
831 views
0 votes
1 answer

Can't Click an Element in Python Selenium After Successfully Finding It

I've encountered this problem of not being ...READ MORE

Oct 8, 2018 in Python by Priyaj
• 58,090 points
829 views
0 votes
1 answer

Python: nested 'for' loops

Could use itertools: >>> for comb in itertools.combinations_with_replacement(range(9, -1, ...READ MORE

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

Python script if-else statement doubt

The reason for this is that the else loop ...READ MORE

May 23, 2019 in Python by Rajan
827 views
0 votes
1 answer

Remove a string suffix

You can remove the substring using slicing. ...READ MORE

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

Python set Union and set Intersection operate differently?

When you do set() you are creating an empty ...READ MORE

May 24, 2018 in Python by charlie_brown
• 7,720 points
821 views
0 votes
1 answer

Azure VM Monitoring

Hi, @Mukund, For an Azure Virtual Machine, we ...READ MORE

Apr 6, 2020 in Python by Gitika
• 65,910 points
820 views
0 votes
1 answer

What does calling a function means in Python?

Calling a function means that you are ...READ MORE

Dec 18, 2018 in Python by Shuvodip
819 views
0 votes
1 answer

Python ctypes segmentation fault when rootfs is read-only and /tmp is noexec

I cant really seem to reproduce the ...READ MORE

Aug 28, 2018 in Python by anonymous
818 views
0 votes
1 answer

What is a tuple in python?

A tuple is a collection data type ...READ MORE

May 21, 2019 in Python by Mohammad
• 3,230 points
817 views
0 votes
0 answers

how to deploy bluk python yamls on kubernetes using jinja template

1.how to deploy  python  services yamls  or ...READ MORE

Mar 19, 2019 in Python by devops learner
816 views
0 votes
1 answer

Install Python packages on Windows?

First, pip is preferred over easy_install.  Then follow these steps to ...READ MORE

Oct 29, 2018 in Python by Priyaj
• 58,090 points
816 views
0 votes
1 answer

Difference between del, remove and pop on lists

es, remove removes the first matching value, ...READ MORE

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

Shuffling a Word

You can try the following: import random word = ...READ MORE

Jan 30, 2019 in Python by SDeb
• 13,300 points
815 views
0 votes
2 answers

Calling an external command in Python

import os os.system('external_command') Replace external_command in the above code ...READ MORE

Oct 16, 2018 in Python by Omkar
• 69,230 points
815 views
0 votes
1 answer

What are the arguments of sorted() function in Python?

Sorted() sorts any sequence (list, tuple) and ...READ MORE

Jul 29, 2019 in Python by Neel
• 3,020 points
814 views
0 votes
1 answer

Generators with plots

Yes, you can. I tried doing it ...READ MORE

Jul 16, 2019 in Python by Wajiha
• 1,950 points
814 views
0 votes
1 answer

Best way to avoid stale *.pyc files?

There is a useful environment variable for ...READ MORE

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

Increment operators in Python

Python has no unary operators. So use ...READ MORE

May 12, 2018 in Python by Hamartia's Mask
• 1,580 points
814 views
0 votes
1 answer

position error

Hi, @There, The key error generally means the ...READ MORE

Oct 23, 2020 in Python by Gitika
• 65,910 points
811 views
0 votes
1 answer

how to convert a group of strings to integer?

a = ['1','2','3','4'] b = list(map(int,a)) print(b) this is how ...READ MORE

Mar 18, 2019 in Python by Mohammad
• 3,230 points
811 views
+1 vote
2 answers

Multiple line comment in Python

Try this ''' This is a multiline comment. ...READ MORE

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

How to sort json file ascending in pymongo?

Hey Ahmad, you can get the output ...READ MORE

Aug 14, 2019 in Python by Trisha
808 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,700 points
807 views
0 votes
1 answer

How to debug in Django code?

Hello @kartik, There are a bunch of ways ...READ MORE

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

What are good rules of thumb for Python imports?

I would normally use import X on module level. ...READ MORE

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

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

Print C format in Python

For printf- style formatting and special case ...READ MORE

Sep 18, 2018 in Python by SDeb
• 13,300 points
807 views
0 votes
1 answer

How to traverse from a file to parse another file?

You use os.walk() module of python for ...READ MORE

Jan 2, 2019 in Python by Omkar
• 69,230 points
806 views
0 votes
1 answer

How to convert an integer to a string using Python?

Here is an easy solution: def numberToBase(n, b): ...READ MORE

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

edited Dec 12, 2018 by Nymeria 806 views
0 votes
1 answer

How to get the position of a character in Python?

There are two string methods for this, find() and index(). ...READ MORE

Jan 5, 2021 in Python by Gitika
• 65,910 points
803 views
0 votes
1 answer

What is the difference between Python's list methods append and extend?

Appends object at the end. x = [1, ...READ MORE

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

Django AllAuth gives SSLError

It can be fixed by replacing: client = ...READ MORE

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

Why am I getting a error when I am printing two different data types in python?

different data type is being used. that ...READ MORE

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

What is the purpose of Zope Interfaces?

You can actually test if your object ...READ MORE

Feb 28, 2019 in Python by SDeb
• 13,300 points
803 views