Trending questions in Python

0 votes
0 answers

How to solve the error of Cant execute the script.

Hey!, I am new to python i ...READ MORE

Mar 31, 2021 in Python by anonymous

edited Mar 4 69 views
0 votes
0 answers

How to fix AttributeError: 'Turtle' object has no attribute 'xcore'

# setting up the screen import turtle import math wn ...READ MORE

Mar 30, 2021 in Python by Dembabe

edited Mar 4 89 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

Aug 7, 2020 in Python by Niroj
• 82,840 points
10,189 views
0 votes
1 answer
0 votes
1 answer

How to set value for particular cell in pandas DataFrame using index?

Why df.xs('C')['x']=10 does not work: df.xs('C') by default, returns a new ...READ MORE

Jan 5, 2021 in Python by Gitika
• 65,770 points
3,634 views
0 votes
1 answer

AttributeError: type object 'numpy.ndarray' has no attribute '__array_function__'

Hi@akhtar, I think numpy version is not compatible ...READ MORE

Apr 13, 2020 in Python by MD
• 95,460 points
15,127 views
0 votes
1 answer

Error is '<' not supported between instances of str and int

your dis is obviously not 1.13, it's ...READ MORE

Nov 15, 2020 in Python by Gitika
• 65,770 points
5,763 views
0 votes
1 answer

How do you add a background thread to flask in Python?

The example below creates a background thread ...READ MORE

Nov 19, 2018 in Python by Nymeria
• 3,560 points
37,164 views
0 votes
1 answer

Python and pip, list all versions of a package that's available?

The script at Pastebin does work. However, ...READ MORE

Nov 22, 2020 in Python by Gitika
• 65,770 points
5,442 views
0 votes
0 answers

How can store list of id in foreign key django ?

I am trying to store multiple product ...READ MORE

Mar 27, 2021 in Python by usman

edited Mar 4 75 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,840 points
7,077 views
0 votes
1 answer

Error: No module named 'django.core.urlresolvers'

Hello @kartik, If you want to import reverse, ...READ MORE

Aug 5, 2020 in Python by Niroj
• 82,840 points
10,133 views
0 votes
1 answer

React native for frontend and python is for backend app development it is possible??

Hello @Rithika , Yes, it is possible. For example, you ...READ MORE

Oct 30, 2020 in Python by Niroj
• 82,840 points
6,398 views
0 votes
1 answer

How to Install Python packages from local file system folder to virtualenv with pip?

Hello @kartik, You can try the code below: pip ...READ MORE

May 12, 2020 in Python by Niroj
• 82,840 points

edited Oct 7, 2021 by Sarfaraz 13,781 views
0 votes
0 answers

how can I fix this problem AttributeError: '<invalid type>' object has no attribute 'title' on line 11 in main.py

The section I'm having trouble with is ...READ MORE

Mar 25, 2021 in Python by anonymous

edited Mar 4 69 views
0 votes
0 answers

How to read file and match string from content and then download S3 file

I have multiple files in an S3 ...READ MORE

Mar 24, 2021 in Python by Shivam

edited Mar 4 56 views
0 votes
3 answers

How do I use raw_input in Python 3?

raw_input() was renamed to input() in Python 3. Another example ...READ MORE

Jan 4, 2021 in Python by Carlos
3,339 views
0 votes
1 answer

How to perform HTML decoding/encoding using Python/Django?

Hello, For html encoding, there's cgi.escape from the standard library: >> ...READ MORE

May 7, 2020 in Python by Niroj
• 82,840 points
13,895 views
0 votes
1 answer

How to convert CSV file to JSON file using Pandas?

Hi@akhtar, You can convert your CSV file to ...READ MORE

Jun 25, 2020 in Python by MD
• 95,460 points
11,661 views
0 votes
0 answers

python please help, I'm getting max_X not defined

from sklearn.model_selection import cross_val_score max_k = 100 cv_scores = ...READ MORE

Mar 22, 2021 in Python by anonymous

edited Mar 4 46 views
0 votes
2 answers

what path should I give to the url for showing a pop up when clicking on "more info" button in django?

I think u can use the bootstrap ...READ MORE

Dec 29, 2020 in Python by Carlos
3,539 views
0 votes
1 answer

Everything in python is object?

In object-oriented programming languages like Python, an ...READ MORE

Jul 30, 2021 in Python by Rachana priyadarshni samal

edited Mar 5 688 views
0 votes
1 answer

How do I install a Python package with a .whl file?

I just used the following which was ...READ MORE

Nov 20, 2020 in Python by Gitika
• 65,770 points
5,199 views
0 votes
0 answers

error install mysqlclient on windows

i have that error (dont find answer) ...READ MORE

Feb 7, 2021 in Python by anonymous
• 120 points
1,842 views
0 votes
0 answers

HOW TO SOLVE - Found input variables with inconsistent numbers of samples: [2285, 762] ERROR

import pandas as pd import numpy as np df ...READ MORE

Mar 19, 2021 in Python by Manu

edited Mar 4 93 views
0 votes
1 answer

Importing files from different folder in python.

By default, you can't. When importing a ...READ MORE

Dec 20, 2020 in Python by Nikita
3,890 views
0 votes
1 answer

How do I update pip itself from inside my virtual environment?

Hello, pip is just a PyPI package like any other; you ...READ MORE

Nov 20, 2020 in Python by Niroj
• 82,840 points
5,143 views
0 votes
1 answer

What is the purpose of ​#!/usr/bin/python​on the first line in the above code?

Hey, @Roshni, By specifying #!/usr/bin/python you specify exactly ...READ MORE

Jun 23, 2020 in Python by Gitika
• 65,770 points
11,546 views
0 votes
0 answers

how to install PyAudio???

hi, I'm working on a project and ...READ MORE

Mar 18, 2021 in Python by Modern

edited Mar 4 43 views
0 votes
1 answer

How to avoid missing module docstring in pylint?

Either write your docs or use a ...READ MORE

Nov 6, 2020 in Python by anonymous
• 65,770 points
5,656 views
0 votes
1 answer

How to send a correct authorization header for basic authentication

Hello @kartik, Here is how to do Basic ...READ MORE

Aug 13, 2020 in Python by Niroj
• 82,840 points
9,244 views
0 votes
1 answer

How to return custom JSON in Django REST Framework?

Hello @kartik, There are 2 ways to custom ...READ MORE

Jun 25, 2020 in Python by Niroj
• 82,840 points
11,311 views
0 votes
1 answer

Python: ImportError: No module named Crypto.Cipher

Seems like the pycrypto package is not ...READ MORE

Jul 31, 2019 in Python by Hari
25,556 views
0 votes
1 answer

Error: Catch a thread's exception in the caller thread in Python

The problem is that thread_obj.start() returns immediately. The child ...READ MORE

Nov 2, 2020 in Python by Gitika
• 65,770 points
5,619 views
0 votes
1 answer

What is `related_name` used for in Django?

Hello @kartik, The related_name attribute specifies the name of the ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,840 points
11,197 views
0 votes
1 answer

Error:django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

Hello @kartik, It looks like you don't have ...READ MORE

Jun 24, 2020 in Python by Niroj
• 82,840 points
11,275 views
0 votes
1 answer

Import error: No module name urllib2

As stated in the urllib2 documentation: The urllib2 module has been split ...READ MORE

May 11, 2020 in Python by Niroj
• 82,840 points
13,164 views
0 votes
1 answer

How to disable a method in a ViewSet, django-rest-framework

Hello @kartik, You could keep using viewsets.ModelViewSet and define http_method_names on your ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,840 points
11,211 views
0 votes
1 answer

Creating an empty Pandas DataFrame, then filling it?

Here's a couple of suggestions: Use date_range for the index: import ...READ MORE

Jan 5, 2021 in Python by Gitika
• 65,770 points
2,835 views
0 votes
1 answer

How to invoke a function on an object dynamically by name?

Use "getattr":  obj = MyClass() try: ...READ MORE

Dec 3, 2020 in Python by Gitika
• 65,770 points
4,244 views
0 votes
1 answer

Pandas df header on 2 row

By default when you import a file, ...READ MORE

Apr 4, 2019 in Python by Yogi
30,578 views
0 votes
0 answers

Hi Guys, I am trying to import matplotlib in my system. But it is showing me the below error.

import matplotlib Traceback (most recent call last):   File "<pyshell#0>", ...READ MORE

Mar 10, 2021 in Python by Dharmendra

edited Mar 4 70 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,840 points
8,861 views
0 votes
0 answers
0 votes
1 answer

Running shell command and capturing the output

Modern versions of Python (3.5 or higher): run If ...READ MORE

Dec 28, 2020 in Python by Gitika
• 65,770 points
3,070 views
0 votes
1 answer

Error like “Your CPU not supported AVX , AVX2”

Cpu avx2 nahi hai kiya kare READ MORE

May 31, 2021 in Python by anonymous

edited Mar 5 1,333 views
0 votes
0 answers

I m getting a error * name ch is not defined*

class Library:     def __init__(self):         self.bookname=""         self.author=""     def getdata(self):         self.bookname = input("Enter Name ...READ MORE

Mar 8, 2021 in Python by CYBER

edited Mar 4 89 views
0 votes
0 answers

ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2

I'm using docker-compose on Ubuntu 20.04. I ...READ MORE

Mar 8, 2021 in Python by Sadaf

edited Mar 4 71 views
0 votes
1 answer

fatal error: Python.h: No such file or directory

On Ubuntu, I was running Python 3 ...READ MORE

Nov 28, 2020 in Python by Gitika
• 65,770 points
4,324 views