Latest questions in Python

0 votes
0 answers

joining two images reading from one folder

Hi, i am trying to generating joined ...READ MORE

Jan 3, 2021 in Python by shapna
• 120 points
532 views
0 votes
0 answers

how to fix the ERROR: Could not find a version that satisfies the requirement engine

when I install engine or anyother module ...READ MORE

Jan 3, 2021 in Python by Muhammad Ali
• 120 points
1,700 views
0 votes
1 answer

Error in jarvis project (get url)

Hey, @Zodarlxx, Could you please post your error ...READ MORE

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

How to ignore Headers in S3 bucket CSV file using python?

Hi@durgaraju, You can fetch only the body part. ...READ MORE

Dec 29, 2020 in Python by MD
• 95,440 points
1,894 views
0 votes
3 answers

How can I sort a dictionary by key in python?

Another way could be: color_dict = {'red':'#FF0000',           'green':'#008000',           'black':'#000000',           'white':'#FFFFFF'} for ...READ MORE

Dec 28, 2020 in Python by Thomas Walenta
834 views
0 votes
2 answers

How do I check if a variable exists in python?

Python doesn’t have a specific function to ...READ MORE

Dec 28, 2020 in Python by Carlos
11,921 views
0 votes
3 answers

How do I find the location of my Python site-packages directory?

Configuring Python to use additional locations for ...READ MORE

Dec 28, 2020 in Python by Nikita
87,519 views
0 votes
3 answers

Best way to convert string to bytes in Python?

We can use the built-in Bytes class in Python ...READ MORE

Dec 28, 2020 in Python by David Samon
29,941 views
0 votes
3 answers

Count the number occurrences of a character in a string

The string count() method returns the number of occurrences of ...READ MORE

Dec 28, 2020 in Python by Carlos
13,402 views
0 votes
3 answers

Is there a simple way to delete a list element by value?

There are three ways in which you ...READ MORE

Dec 28, 2020 in Python by Thomas Walenta
503 views
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,910 points
2,539 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
2,989 views
0 votes
1 answer

Hey Does anybody know how to fix the unexpected indent error?

Hello, @Aarohan, As the error message indicates, you ...READ MORE

Dec 28, 2020 in Python by Gitika
• 65,910 points
430 views
0 votes
1 answer
0 votes
0 answers

I can't get accurate value in dictionaries in django

Whenever I try to print the dictionaries ...READ MORE

Dec 25, 2020 in Python by Mohamed
• 170 points
353 views
0 votes
1 answer

For Professional window GUI develepoment which python lib/module/framework is best?

HI, @Ganesh, Tkinter is one of the most ...READ MORE

Dec 24, 2020 in Python by Gitika
• 65,910 points
399 views
0 votes
1 answer

Getting error "AttributeError: 'Screen' object has no attribute 'title' on line 8"

Hey @TedTickles,  Replace  wn.update() with turtle.up ...READ MORE

Dec 24, 2020 in Python by Gitika
• 65,910 points
3,482 views
0 votes
1 answer

How to read a text file into a string variable and strip newlines?

You could use: with open('data.txt', 'r') as file: ...READ MORE

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

Adding new column to existing DataFrame in Python pandas

Use the original df1 indexes to create ...READ MORE

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

if/else in a list comprehension

You can totally do that. It's just ...READ MORE

Dec 23, 2020 in Python by Gitika
• 65,910 points
3,963 views
0 votes
1 answer

How to get list from pandas DataFrame column headers?

You can get the values as a ...READ MORE

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

how can I save my output of xml parsing in excel file...?

Hi, @Arjmand, I would suggest you go through ...READ MORE

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

please what does print_details do in python?

Hi, @There, The print() function prints the specified message to the ...READ MORE

Dec 23, 2020 in Python by Gitika
• 65,910 points
399 views
+1 vote
1 answer

tensorflow is installed but theres an error while importing

Hi@Christlan, This problem is related to version. Follow ...READ MORE

Dec 22, 2020 in Python by MD
• 95,440 points
12,735 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
8,516 views
0 votes
1 answer

Delete column from pandas DataFrame in python

As you've guessed, the right syntax is del ...READ MORE

Dec 20, 2020 in Python by Gitika
• 65,910 points
746 views
0 votes
1 answer

Getting the class name of an instance?

Have you tried the __name__ attribute of the class? ie type(x).__name__ will ...READ MORE

Dec 20, 2020 in Python by Gitika
• 65,910 points
358 views
0 votes
1 answer

How to pad zeroes to a string?

Strings: >>> n = '4' >>> print(n.zfill(3)) 004 And for numbers: >>> ...READ MORE

Dec 20, 2020 in Python by Gitika
• 65,910 points
402 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,558 views
0 votes
1 answer

How do you append to a file in Python?

with open("test.txt", "a") as myfile: ...READ MORE

Dec 20, 2020 in Python by Gitika
• 65,910 points
485 views
0 votes
1 answer

Exception in Tkinter callback Traceback (most recent call last):

Hello, @R, As per the Beautiful Soup Documentation: AttributeError: 'NoneType' ...READ MORE

Dec 21, 2020 in Python by Gitika
• 65,910 points
19,273 views
0 votes
1 answer

Meaning of @classmethod and @staticmethod for beginner?

Example class Date(object): def __init__(self, ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,910 points
409 views
0 votes
1 answer

How can I count the occurrences of a list item?

If you only want one item's count, ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,910 points
488 views
0 votes
1 answer

How to remove an element from a list by index?

Use del and specify the index of the element ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,910 points
564 views
0 votes
1 answer

How can I print literal curly-brace characters in python string and also use .format on it?

You need to double the {{ and }}: >>> x = ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,910 points
460 views
0 votes
1 answer

How can I remove a trailing newline?

Try the method rstrip() (see doc Python 2 and Python 3) >>> 'test ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,910 points
649 views
0 votes
1 answer

Why is reading lines from stdin much slower in C++ than Python?

tl;dr: Because of different default settings in ...READ MORE

Dec 18, 2020 in Python by Nikita
1,005 views
0 votes
1 answer

HI Mr / Mrs I have problem with my jupiter notebook when i try to learn Your video about Machine Learning. Can You help me please ?

Hi@Herlambang, I think you have a 32-bit system. ...READ MORE

Dec 18, 2020 in Python by MD
• 95,440 points
541 views
0 votes
1 answer

How to print colored text in Python?

This somewhat depends on what platform you ...READ MORE

Dec 17, 2020 in Python by Gitika
• 65,910 points
1,260 views
0 votes
1 answer

How to delete a file or folder?

os.remove() removes a file. os.rmdir() removes an empty directory. shutil.rmtree() deletes a ...READ MORE

Dec 17, 2020 in Python by Nikita
370 views
0 votes
1 answer

How to find current directory and file's directory?

To get the full path to the ...READ MORE

Dec 17, 2020 in Python by Gitika
• 65,910 points
2,248 views
0 votes
1 answer

“Least Astonishment” and the Mutable Default Argument

Actually, this is not a design flaw, ...READ MORE

Dec 17, 2020 in Python by Gitika
• 65,910 points
334 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
7,342 views
0 votes
1 answer

How to catch multiple exceptions in one line in python?

From Python Documentation: An except clause may name multiple ...READ MORE

Dec 17, 2020 in Python by Gitika
• 65,910 points
4,831 views
0 votes
1 answer

How can I add new keys to a dictionary?

d = {'key': 'value'} print(d) # {'key': 'value'} d['mynewkey'] = ...READ MORE

Dec 17, 2020 in Python by Gitika
• 65,910 points
436 views
0 votes
1 answer

Accessing the index in 'for' loops?

Using an additional state variable, such as ...READ MORE

Dec 16, 2020 in Python by Gitika
• 65,910 points
384 views
0 votes
1 answer

How do I check whether a file exists without exceptions?

 It's safer to use a try around the attempt ...READ MORE

Dec 16, 2020 in Python by Gitika
• 65,910 points
492 views
0 votes
1 answer

What does the “yield” keyword do?

To understand what yield does, you must understand what generators are. ...READ MORE

Dec 16, 2020 in Python by Gitika
• 65,910 points
347 views
0 votes
1 answer

ImportError: No module named sklearn.cross_validation

Regarding your query, it must relate to ...READ MORE

Dec 16, 2020 in Python by Nikita
2,869 views
0 votes
1 answer

Error: IndexError: list index out of range and python

IndexError The IndexError is raised when you attempt to retrieve ...READ MORE

Dec 16, 2020 in Python by Gitika
• 65,910 points
1,465 views