Trending questions in Python

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

Aug 6, 2020 in Python by Niroj
• 82,840 points
16,960 views
0 votes
0 answers

DJANGO HELP NEEDED

Whenever I run Command (DJANGO-ADMIN) it gives ...READ MORE

Sep 3, 2021 in Python by Nabeel

edited 4 days ago 8 views
0 votes
0 answers

Why showing This Error:- spiral.forward(i*10) IndentationError: expected an indented block

import turtle sc=turtle.Screen() sc.setup(600,600) spiral=turtle.Tu ...READ MORE

Sep 3, 2021 in Python by Pradip

edited 4 days ago 8 views
0 votes
2 answers

NameError: name 'raw_input' is not defined

Hi, There may a problem with your python ...READ MORE

Jun 25, 2020 in Python by MD
• 95,460 points
32,984 views
0 votes
1 answer

AttributeError: module 'numpy' has no attribute '__version__'

Hi@akhtar, To avoid this error you can use ...READ MORE

Apr 20, 2020 in Python by MD
• 95,460 points
21,560 views
0 votes
0 answers

IndentationError: expected an indented block, while executing elbow method

K = range(1,10) sum_sq_dst = [] for k in ...READ MORE

Sep 1, 2021 in Python by Edureka

edited 4 days ago 7 views
0 votes
1 answer

TypeError: list indices must be integers or slices, not str

Hi@akhtar, As we know that the index of ...READ MORE

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

How to access a dictionary element in a Django template?

Hello @kartik, Use Dictionary Items: {% for key, value ...READ MORE

Jul 3, 2020 in Python by Niroj
• 82,840 points
18,017 views
0 votes
1 answer

UnicodeDecodeError: "utf-8" codec can"t decode byte 0xeb in position 8: unexpected end of data

To read this dataset use encoding as ...READ MORE

Jul 15, 2019 in Python by Rishi
33,302 views
0 votes
2 answers

How to call perl script in Python script?

If you just want to open a ...READ MORE

Oct 7, 2020 in Python by Reshma
13,831 views
0 votes
4 answers

Install Python3 on Mac

Prerequisites You will need a macOS computer with ...READ MORE

Dec 15, 2020 in Python by Roshni
• 10,480 points
19,916 views
0 votes
0 answers

[Errno 11001] getaddrinfo failed

I am getting the error : [Errno 11001] ...READ MORE

Aug 20, 2021 in Python by Richa

edited 4 days ago 6 views
0 votes
0 answers
0 votes
1 answer

Error:Django TemplateSyntaxError - 'staticfiles' is not a registered tag library

Hello @kartik, Try {% load static %} instead of {% load ...READ MORE

Jul 29, 2020 in Python by Niroj
• 82,840 points
16,591 views
0 votes
2 answers

How can I write a program to add two numbers using functions in python?

there is sum() function as a built ...READ MORE

Oct 25, 2020 in Python by anonymous
24,032 views
0 votes
2 answers

How do I set the figure title and axes labels font size in Matplotlib?

Setting the font size of the figure ...READ MORE

Jan 4, 2021 in Python by Nikita
9,419 views
0 votes
1 answer

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

Hi, @hala, Regarding your query, you can go ...READ MORE

Jun 29, 2020 in Python by Niroj
• 82,840 points
17,757 views
0 votes
0 answers

I tried to import turtle and I tried to write sc = turtle.Screen() but it gives attribute error in these.

import turtle    # make screen object # and set ...READ MORE

Aug 6, 2021 in Python by anonymous

edited 4 days ago 7 views
0 votes
1 answer

ModuleNotFoundError: No module named 'nltk'

Hi@akhtar, It seems this module is not present ...READ MORE

Jun 26, 2020 in Python by MD
• 95,460 points
17,446 views
+1 vote
1 answer

Error:__init__() got an unexpected keyword argument 'user'

Hello @kartik, You can't do LivingRoom.objects.create(user=instance) because you have an __init__ method ...READ MORE

Jun 30, 2020 in Python by Niroj
• 82,840 points
17,241 views
0 votes
2 answers

ModuleNotFoundError: No module named 'apyori'

apriori is python 2.7 module so this ...READ MORE

Jun 9, 2020 in Python by sahil
• 500 points
18,161 views
0 votes
0 answers

I have the following python script. I keep getting "AxisError" at the # First Derivative in time.

# Creating Features Space features = {} # Raw ...READ MORE

Aug 3, 2021 in Python by Edureka

edited 4 days ago 8 views
0 votes
1 answer

ValueError: could not broadcast input array from shape (360,270,3) into shape (360,280,3)

Hi@akhtar, In the above error it shows could not ...READ MORE

Apr 9, 2020 in Python by MD
• 95,460 points
20,718 views
0 votes
1 answer

How to load python script in Jupyter Notebook?

Hi@akhtar, Starting from IPython 3 (now Jupyter project), ...READ MORE

Aug 17, 2020 in Python by MD
• 95,460 points
15,050 views
0 votes
2 answers

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

R u getting the issue while running ...READ MORE

Nov 2, 2020 in Python by anonymous
11,635 views
0 votes
1 answer

What will be the output of below code and why? x=[1,2,3,4,5] print(x.insert(2,3))

x=1, x=2, x=3, x=4, x=5 READ MORE

Sep 28, 2021 in Python by Harsh yadav

edited 4 days ago 4,693 views
0 votes
0 answers

How can I fix the attribute error in my pycharm IDE?

Traceback (most recent call last):   File "C:\Users\SONY\PycharmProjects\Python Tuts\.idea\chammach.py", ...READ MORE

Jul 25, 2021 in Python by anonymous

edited 4 days ago 8 views
+1 vote
2 answers

Python error "ZeroDivisionError: float division by zero"

The error is thrown in this line matchPercentage ...READ MORE

May 21, 2020 in Python by Prabhakar
23,290 views
0 votes
0 answers

how should i get rid of the error, so my codes runs?

ValueError: invalid literal for int() with base ...READ MORE

Jul 24, 2021 in Python by anonymous

edited 4 days ago 8 views
0 votes
1 answer

Why can't Python parse this JSON data?

Your data is not a valid JSON format. You ...READ MORE

Dec 20, 2020 in Python by Reshma
9,093 views
0 votes
0 answers

I'm trying to run this code but I got this error: ZeroDivisionError: float division by zero in this q_values[action2] = summ / len(delays_history[action2])

number_of_actions = 5 max_value = 2 Prev_max_value = 0 costs ...READ MORE

Jul 16, 2021 in Python by Medo

edited 4 days ago 7 views
0 votes
1 answer

'utf-8' codec can't decode byte 0x82 in position 16: invalid start byte

Hi@zena, The error is because there is some non-ASCII ...READ MORE

Jun 29, 2020 in Python by MD
• 95,460 points
16,453 views
0 votes
0 answers

Hello. I'm trying to convert this string '0x278a51da' into a integer so I can use it on the ctime() from time.

time_in_hexa_format_as_string = '0x278a51da' def get_time_stamp(value_for_time): ...READ MORE

Jul 12, 2021 in Python by Rafael

edited 4 days ago 9 views
0 votes
0 answers

Type() function in Python

.I know that type() function is used ...READ MORE

Jul 10, 2021 in Python by Brijesh
• 120 points

edited 4 days ago 9 views
0 votes
0 answers

python: how to print the data frame columns with out index and also left indent

Hi There, Basically I want to read a ...READ MORE

Jul 9, 2021 in Python by balaji

edited 4 days ago 14 views
0 votes
1 answer

How to Install pip for python 3.7 on Ubuntu 18?

The command you're looking for is: python3.7 -m ...READ MORE

Nov 20, 2020 in Python by Gitika
• 65,770 points
9,809 views
0 votes
1 answer

How to use Django variable in JavaScript file?

Hello @kartik, You need to print it before ...READ MORE

Jul 29, 2020 in Python by Niroj
• 82,840 points
14,738 views
0 votes
1 answer

How to get Request.User in Django-Rest-Framework serializer?

Hello @kartik, You cannot access the request.user directly. You need ...READ MORE

Aug 12, 2020 in Python by Niroj
• 82,840 points
14,045 views
0 votes
2 answers

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 16: invalid start byte

Thanks, This answer was helpful. READ MORE

Jul 11, 2020 in Python by Prashant Chhatrashali
17,323 views
0 votes
0 answers

I am using Django to create a user and an object when the user is created. But there is an error

I am using Django to create a ...READ MORE

Jun 30, 2021 in Python by Sudhir

edited 4 days ago 8 views
0 votes
0 answers

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

Hi guys i have below code . ...READ MORE

Oct 30, 2019 in Python by sumanth
• 190 points
12,099 views
0 votes
0 answers

why there has an error i tried so many time

#Function is defined def eq1( vi, t, a): d ...READ MORE

Jun 28, 2021 in Python by Zahir

edited 4 days ago 9 views
0 votes
0 answers

How do I make a command in python?

Hi. I and my sister wanted to ...READ MORE

Jun 28, 2021 in Python by anonymous

edited 4 days ago 9 views
+1 vote
1 answer

module 'numpy' has no attribute 'unit8'

Hi@akhtar, You have used unit8 in your code. ...READ MORE

Jun 23, 2020 in Python by MD
• 95,460 points
15,906 views
0 votes
1 answer

gaierror: [Errno 11003] getaddrinfo failed

Hi@akhtar, It most likely means the hostname of ...READ MORE

Apr 15, 2020 in Python by MD
• 95,460 points
18,895 views
0 votes
0 answers

How to check an IP address is within a range of two IPs in Python?

I have an IP address and I'm ...READ MORE

Jun 26, 2021 in Python by Izahaak

edited 4 days ago 9 views
0 votes
1 answer

How to PATCH a single field using Django Rest Framework?

Hello @kartik, Serializers allow partial updates by specifying partial=True when initializing ...READ MORE

Jun 25, 2020 in Python by Niroj
• 82,840 points
15,746 views
0 votes
0 answers

I want to raise the value by 500 of existing column (of annual income) in python

I'm trying to model a ubi on ...READ MORE

Jun 25, 2021 in Python by Lee

edited 4 days ago 7 views
0 votes
0 answers

'tuple' object is not callable

mass=int(input("Enter mass:")) change=int(input('enter the change in temperature:')) specific_heat=4184 cal=mass*specific_heat*change print("Your total ...READ MORE

Jun 25, 2021 in Python by Sukesh

edited 4 days ago 8 views
0 votes
1 answer

How to add multiple columns to pandas dataframe in one assignment?

Hello @kartik, You could use assign with a dict of ...READ MORE

Jun 15, 2020 in Python by Niroj
• 82,840 points
16,111 views