Trending questions in Python

+1 vote
6 answers

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

Hey, I tried to look for a few ...READ MORE

Jul 1 in Python by keshav
114,613 views
0 votes
3 answers

In Python, what is difference between Array and List?

Lists and arrays are used in Python ...READ MORE

Mar 15, 2019 in Python by Taj
• 1,060 points

edited Mar 18, 2019 by Omkar 75,170 views
+6 votes
6 answers

What exactly is the function of random.seed() in python?

The seed method is used to initialize the ...READ MORE

Oct 29, 2018 in Python by Rahul
82,608 views
+1 vote
2 answers

How to change/update cell value in Python Pandas dataframe?

You can use the at() method to ...READ MORE

Apr 8, 2019 in Python by Kunal
65,910 views
+2 votes
11 answers

How to print array/ list without brackets in python?

print(*names, sep = ', ') This is what ...READ MORE

Dec 10, 2018 in Python by Sudo
79,001 views
+1 vote
3 answers

Python error "ERROR: Could not find a version that satisfies the requirement PyQt4 (from versions: none)"

You cannot install PyQt directly from pip. ...READ MORE

Jul 22, 2019 in Python by Bob
42,133 views
+2 votes
1 answer

UnicodeDecodeError: "utf-8" codec can't decode byte in position : invalid start byte

You have to use the encoding as latin1 ...READ MORE

Jul 23, 2019 in Python by Kunal
43,225 views
+2 votes
1 answer

Python: UnicodeDecodeError: "utf-8" codec can"t decode byte 0xa0 in position 10: invalid start byte

You have to use the encoding as latin1 ...READ MORE

Jul 11, 2019 in Python by Ritu
43,430 views
0 votes
2 answers

Python error "IndentationError: expected an indented block"

Putting in an extra space or leaving ...READ MORE

Mar 2 in Python by evanbung
• 180 points
36,145 views
+1 vote
1 answer

How can I use python to execute a curl command?

For sake of simplicity, maybe you should ...READ MORE

Oct 11, 2018 in Python by charlie_brown
• 7,780 points
48,398 views
0 votes
2 answers

How to use not equal operator in python

You can use "!=" and "is not" ...READ MORE

Mar 17 in Python by rahul
• 360 points
33,380 views
0 votes
1 answer

Python Pandas error: AttributeError: 'DataFrame' object has no attribute 'rows'

There is no attribute called “rows”. The ...READ MORE

Mar 28, 2019 in Python by Shri
36,680 views
0 votes
2 answers

How do I remove an element from a list by index in Python?

Delete the List and its element: We have ...READ MORE

Jun 7 in Python by sahil
• 540 points
22,445 views
0 votes
1 answer

Python Pandas: ValueError: DataFrame constructor not properly called!

The syntax is not right. The right ...READ MORE

Mar 28, 2019 in Python by Ritu
32,097 views
+1 vote
4 answers

What do you mean by python scripting? What is a script and a module in python?

A module is a file containing a ...READ MORE

Jun 17, 2019 in Python by Zain Abbas
29,686 views
0 votes
1 answer

How to get the return value from a thread using python?

You don't need to change your existing ...READ MORE

Dec 3, 2018 in Python by Nymeria
• 3,520 points

edited Dec 19, 2018 by Nymeria 36,270 views
+1 vote
2 answers

How to install tkinter in pycharm?

Ya, this is a problem with installing ...READ MORE

Apr 3, 2019 in Python by Jishan
25,191 views
0 votes
3 answers

How can I use grep in Python?

Hello,  Here goes a short demonstration on How ...READ MORE

Jul 1 in Python by Nagaraj

edited Jul 2 21,932 views
0 votes
1 answer

How to find the index of a particular value in a dataframe?

First, use the dataframe to match the ...READ MORE

Apr 8, 2019 in Python by Esha
29,162 views
0 votes
3 answers

Python error "NameError: name 'sr' is not defined"

NameError: name 'xx' is not defined Python knows ...READ MORE

Mar 19 in Python by rahul
• 360 points
23,915 views
0 votes
1 answer

TypeError: unsupported operand type(s) for -: 'str' and 'str'

Hi. This error is caused because you ...READ MORE

May 12, 2019 in Python by Anjali
26,231 views
0 votes
3 answers

TypeError: Index(...) must be called with a collection of some kind, 'Email' was passed

It is not working because your code ...READ MORE

May 12 in Python by anonymous

edited May 13 by Gitika 18,531 views
+1 vote
1 answer

Python: convert txt file to csv format with rows and columns

This code should work. You have to ...READ MORE

Aug 1, 2019 in Python by Ashish
21,356 views
0 votes
1 answer

Python exit commands - why so many and when should each be used?

Let me give some information on them: quit ...READ MORE

Aug 27, 2018 in Python by Priyaj
• 57,550 points
35,413 views
0 votes
2 answers

How to read Pandas csv file with no header?

Use this logic, if header is present ...READ MORE

Mar 14 in Python by Shahabuddin
• 140 points
17,221 views
+1 vote
1 answer

ModuleNotFoundError: No module named 'cv2'

Hi@akhtar, This error may occur if you didn't install ...READ MORE

Apr 9 in Python by MD
• 41,340 points
7,641 views
+2 votes
1 answer

ModuleNotFoundError: No module named 'Crypto'

The module you’ve installed is different. To install ...READ MORE

Aug 20, 2019 in Python by Raman
17,255 views
0 votes
1 answer

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

Hi@akhtar, If you trying to append data in ...READ MORE

May 5 in Python by MD
• 41,340 points
5,714 views
0 votes
1 answer

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Nadeem\AppData\Local\Temp\

Hi@akhtar, I think you are using previous version ...READ MORE

May 4 in Python by MD
• 41,340 points
5,389 views
0 votes
3 answers

what is the difference between append and insert in python lists?

There is a simple difference between append ...READ MORE

Jun 22, 2019 in Python by Harshdeep Khatke
13,458 views
0 votes
1 answer

How to print objects of class using print function in Python?

It can be done as shown below: class Element: ...READ MORE

Dec 3, 2018 in Python by Nymeria
• 3,520 points

edited Dec 19, 2018 by Nymeria 26,623 views
0 votes
1 answer

How to drop all tables from the database with manage.py CLI in Django?

Hello @kartik, Python you can write your own ...READ MORE

16 hours ago in Python by Niroj
• 43,540 points
15 views
0 votes
1 answer

Error:AttributeError: 'module' object has no attribute 'tests'

Hello @kartik, The problem was that test couldn't find ...READ MORE

23 hours ago in Python by Niroj
• 43,540 points
23 views
0 votes
1 answer

How to check permission inside a template in Django?

Hello @kartik, To check for permissions in templates, ...READ MORE

14 hours ago in Python by Niroj
• 43,540 points
7 views
0 votes
1 answer

How to clear a database from the CLI with manage.py in Django?

Hello @kartik, To drop the database and run syncdb again. ...READ MORE

15 hours ago in Python by Niroj
• 43,540 points
8 views
0 votes
1 answer

How can I find the union of two Django querysets?

Hello @kartik, Try this: records = query1 | query2 If ...READ MORE

15 hours ago in Python by Niroj
• 43,540 points
7 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

23 hours ago in Python by Niroj
• 43,540 points
12 views
0 votes
1 answer

Django object is not JSON serializable

Hello @kartik, simplejson and json don't work with django objects well. Django's ...READ MORE

23 hours ago in Python by Niroj
• 43,540 points
12 views
0 votes
1 answer

How can I generating file to download with Django?

Hello @kartik, To trigger a download you need ...READ MORE

21 hours ago in Python by Niroj
• 43,540 points
9 views
0 votes
1 answer

How to change the default Django date template format?

Hello @kartik, Within your template, you can use ...READ MORE

22 hours ago in Python by Niroj
• 43,540 points
8 views
0 votes
1 answer

How to compare two JSON objects with the same elements in a different order equal?

Hello @kartik, If you want two objects with ...READ MORE

21 hours ago in Python by Niroj
• 43,540 points
5 views
0 votes
2 answers

ModuleNotFoundError: No module named 'pythoncom' in pyttsx3

even i faced the same problem ...just ...READ MORE

Jun 2 in Python by anonymous
3,835 views
0 votes
1 answer

How to get the current URL within a Django template?

Hello @kartik, You can fetch the URL in ...READ MORE

1 day ago in Python by Niroj
• 43,540 points
14 views
0 votes
1 answer

How can I get the absolute URL (with domain) in Django?

Hello @kartik, Use handy request.build_absolute_uri() method on request, pass it ...READ MORE

1 day ago in Python by Niroj
• 43,540 points
20 views
0 votes
1 answer

How do I make a field readonly (or disabled) so that it cannot be edited in Django form?

Hello @kartik, Setting readonly on a widget only makes the ...READ MORE

1 day ago in Python by Niroj
• 43,540 points
18 views
0 votes
1 answer

Why does DEBUG=False setting make my django Static Files Access fail?

Hello @kartik, If you still need to server ...READ MORE

1 day ago in Python by Niroj
• 43,540 points
17 views
0 votes
1 answer

How to Creat a JSON response using Django and Python?

Hello @kartik, I usually use a dictionary, not ...READ MORE

1 day ago in Python by Niroj
• 43,540 points
18 views
0 votes
1 answer

Where can I find the error logs of nginx, using FastCGI and Django?

Hello @kartik, Errors are stored in the nginx ...READ MORE

1 day ago in Python by Niroj
• 43,540 points
12 views
0 votes
1 answer

How to Filter for empty or NULL names in a queryset?

Hello @kartik, You could do this: Name.objects.exclude(alias__isnull=True) If you need ...READ MORE

1 day ago in Python by Niroj
• 43,540 points
11 views
0 votes
1 answer

How to debug in Django code?

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

1 day ago in Python by Niroj
• 43,540 points
10 views