Trending questions in Python

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,800 points
19,644 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
15,275 views
0 votes
0 answers

Write a program to find largest of three numbers entered by the user.

pls answer this right now pls pls READ MORE

Sep 14, 2021 in Python by op

edited Mar 4, 2025 463 views
0 votes
0 answers
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
14,703 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,440 points
21,136 views
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,800 points
17,993 views
0 votes
0 answers

How Can I pass a Django Date Range Search Result page by page using Paginator in views and template

I have written a Python Django Method ...READ MORE

Sep 9, 2021 in Python by SUCCESSGANDE

edited Mar 4, 2025 439 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,800 points
19,158 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 Mar 4, 2025 502 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 Mar 4, 2025 476 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
19,893 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 Mar 4, 2025 413 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
25,196 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,800 points
19,024 views
+1 vote
5 answers

Tkinter error: tkinter.TclError: bad geometry specifier

You have to use the character ‘x’ ...READ MORE

May 9, 2019 in Python by Tina
24,037 views
+1 vote
1 answer

Error:Pandas read_csv low_memory and dtype options

Hello @kartik, Try this: dashboard_df = pd.read_csv(p_file, sep=',', error_bad_lines=False, ...READ MORE

Jun 22, 2020 in Python by Niroj
• 82,800 points
18,918 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
20,020 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
18,681 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
• 140 points

edited Mar 4, 2025 551 views
0 votes
0 answers
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
18,387 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 Mar 5, 2025 6,076 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
21,718 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
21,240 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
12,631 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,820 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 Mar 4, 2025 523 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
24,317 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 Mar 4, 2025 512 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
10,096 views
0 votes
1 answer

How to change a Django form field to a hidden field?

Hello @kartik, If you have a custom template ...READ MORE

Jul 29, 2020 in Python by Niroj
• 82,800 points
16,269 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 Mar 4, 2025 455 views
0 votes
2 answers

How do I convert text file to CSV file with only plain python. Meaning no panda or any other special module?

Steps to Convert Text File to CSV ...READ MORE

Oct 15, 2020 in Python by Abdul Shekh
12,568 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 Mar 4, 2025 447 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,730 points
10,787 views
+1 vote
1 answer

How to create a file and save it to a model's FileField in Django?

Hello @kartik, Basically, a field declared as a FileField, ...READ MORE

Jun 30, 2020 in Python by Niroj
• 82,800 points
16,906 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,800 points
15,087 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 Mar 4, 2025 498 views
0 votes
0 answers

The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I couldn't figure out the problem. here my ...READ MORE

Dec 17, 2020 in Python by muammer
• 120 points
9,604 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
17,189 views
0 votes
2 answers

How can I write code to find a palindrome in python without using string functions?

x="malayalam" y="" for i in x: ...READ MORE

Nov 3, 2020 in Python by Thangaraj
25,549 views
0 votes
2 answers

ModuleNotFoundError: No module named 'folium'

Following Command install it will work: conda install ...READ MORE

Aug 28, 2020 in Python by Sunil Patil
16,826 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,800 points
16,983 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,800 points
15,506 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 Mar 4, 2025 451 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 Mar 4, 2025 516 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,800 points
17,261 views