Trending questions in Python

0 votes
1 answer

How to I clear Tkinter Canvas using Python?

To clear a canvas, use the delete method.  This ensures ...READ MORE

Dec 24, 2018 in Python by Nymeria
• 3,560 points
16,046 views
0 votes
1 answer

ProgrammingError: not all arguments converted during string formatting

Sorted!!!! just found the solution, 1 - apparently ...READ MORE

Sep 10, 2018 in Python by Priyaj
• 58,020 points
20,550 views
0 votes
1 answer

How to create LIST from CSV file in Python?

You can use the pandas library for this which ...READ MORE

Jul 15, 2019 in Python by Karan
7,231 views
0 votes
1 answer

How to write inline if statement for print in Python?

Inline if-else expression must always contain the else ...READ MORE

Dec 4, 2018 in Python by Nymeria
• 3,560 points

edited Dec 6, 2018 by Nymeria 16,867 views
+1 vote
1 answer

How do I use the data of an array after splitting it?

Hey, You can use  np.greater(b, f) np.greater_equal(b, f) np.less(b, f) np.less_equal(b, ...READ MORE

Dec 9, 2019 in Python by Payal
819 views
+1 vote
1 answer

How can I delete a file in Python IDLE?

Hey @Starsarwar You have two different codes, they ...READ MORE

Oct 28, 2019 in Python by Kalgi
• 52,350 points
2,586 views
0 votes
1 answer

How can I use the sleep function in a python program?

You can use sleep as below. import time print(" ...READ MORE

Jun 10, 2020 in Python by anonymous
1,097 views
0 votes
2 answers

Explain OOPs concept in python with programatic examples

OOP reflects the real world behavior of ...READ MORE

Jun 24, 2020 in Python by rahul
• 360 points
2,102 views
0 votes
4 answers

What is a Tuple in Python and how to use it?

Tuples  are a  Unchanging sequence of values, ...READ MORE

Jun 21, 2020 in Python by sahil
• 500 points
2,332 views
0 votes
2 answers

Difference between sort and sorted

when to use which? Use list.sort when you ...READ MORE

Mar 26, 2020 in Python by rahul
• 360 points
4,842 views
0 votes
2 answers

Change the default indexing of an array in pandas

df = pd.DataFrame({'month': [1, 4, 7, 10],                    'year': ...READ MORE

Nov 28, 2019 in Python by nagendra reddy
1,264 views
0 votes
1 answer

i am normalizing the data set iris in python and get the error ::TypeError: 'numpy.float64' object is not callable

TRY THIS   #Nomalisation for i in names:     print(i)   ...READ MORE

Aug 20, 2019 in Python by Noel Deepak Palle
6,194 views
0 votes
0 answers

How to read data using popen?

I have written below code and its ...READ MORE

Aug 19, 2019 in Python by anonymous
5,449 views
0 votes
1 answer

How to get anchor tags of particular class using BeautifulSoup?

You can specify the class you want ...READ MORE

Apr 2, 2019 in Python by John
11,388 views
0 votes
1 answer

How to create empty pandas dataframe only with column names?

You can do it like this: df=pd.DataFrame(columns=["Name","Old","Ne ...READ MORE

Apr 6, 2019 in Python by Hari
11,242 views
0 votes
1 answer

Python error "ZeroDivisionError: division by zero"

Catch the error and handle it: try: ...READ MORE

May 31, 2019 in Python by Rhea
8,826 views
+1 vote
2 answers

how can i do a binary search in python?

def Binary_search (array , element):       ...READ MORE

Jul 10, 2020 in Python by anonymous
• 240 points
1,244 views
0 votes
0 answers

I am trying to click the button but it is not working and it is drop list ..

<a class="quickreports btn btn3d tbbtn" href="javascript:" style="position:static" ...READ MORE

Dec 2, 2019 in Python by anonymous
• 120 points
892 views
0 votes
1 answer

What is the difference between print and pprint in Python?

As per the documentation,  The pprint module provides a capability ...READ MORE

Jul 8, 2019 in Python by Arvind
• 3,050 points
7,162 views
0 votes
1 answer

How can i import json file and encrypt it by using ASE MODE CBC encryption ?

Hi @Ahmed. Here's a sample code that ...READ MORE

Aug 20, 2019 in Python by Simran
5,292 views
0 votes
1 answer

input() vs sys.stdin.read()

If you're on Windows, you'll notice that ...READ MORE

Jul 23, 2019 in Python by SDeb
• 13,300 points
6,484 views
0 votes
1 answer

Handling request exceptions while using threads?

There are different places you can add ...READ MORE

Nov 4, 2019 in Python by Richard
1,978 views
+1 vote
0 answers

Sum the values of column matching and not matching from a .txt file and write output to a two different files using Python

Name                                                    value DR_CNDAOFSZAPZP_GPFS_VOL.0 139264 DR_CNDAOFSZAPZP_GPFS_VOL.1 15657 DR_CNDAOFSZAPZP_GPFS_VOL.0 139264 DR_CNDAOFSZAPZP_GPFS_VOL.1 156579 DR_CNDAOFSZAPZP_GPFS_VOL.2 156579 DR_CNDAOFSZAPZP_GPFS_VOL.3 ...READ MORE

Nov 20, 2019 in Python by Sagar
• 130 points
1,291 views
+2 votes
0 answers

I don't want to seem like a begger, but I've been working on this code for the past 3 days and made 0 progress.

Basically, my code runs a turtle and ...READ MORE

Nov 26, 2019 in Python by Kyler
• 140 points
992 views
0 votes
1 answer

Read Nested Json as DataFrame

Here is the code for it. da=[ {"age":34, "id":1, "name":"Tony", "salary":1400, "dept_no":[10,20], "Cntct":{"Phone":[1234567890,9876543210], "state":"NY", ...READ MORE

Jul 25, 2019 in Python by Jimmy
6,244 views
0 votes
1 answer

Python code for printing the string without vowels using list comprehension

Hey @Anvit, you can use something like ...READ MORE

Jul 8, 2019 in Python by Rajeev
6,975 views
0 votes
1 answer

How to print just one column in pandas?

You can use the header to print ...READ MORE

Apr 4, 2019 in Python by TIna
11,099 views
+1 vote
0 answers

ssh db connection using python2.7

I am supposed to use python 2.7 ...READ MORE

Nov 22, 2019 in Python by sweta
• 130 points
1,034 views
0 votes
1 answer

Can we access Outer class member from an Inner class in Python?

If you want to access outer class ...READ MORE

Feb 13, 2019 in Python by Omkar
• 69,220 points
13,249 views
0 votes
1 answer

Python: is thread still running

The key is to start the thread ...READ MORE

Aug 5, 2019 in Python by SDeb
• 13,300 points
5,742 views
0 votes
1 answer

How do I draw a hexagon using the turtle module of python?

Hey @Jinu, try this: import turtle polygon = ...READ MORE

Jun 23, 2019 in Python by Haseeb
7,628 views
0 votes
1 answer

How to get the multiplication table of any number using list comprehension?

Hey @Neha, you can use something like ...READ MORE

Jul 8, 2019 in Python by Sakshi
6,841 views
0 votes
1 answer

Python error "AttributeError: '_Screen' object has no attribute 'mainloop'" python module turtle

Hey @Nagya, replace  wn.mainlopp() with turtle.mainloop() ...READ MORE

Jun 19, 2019 in Python by Faiza
7,519 views
0 votes
1 answer

Pandas vs NumPy

Pandas should be used when you are ...READ MORE

Nov 18, 2019 in Python by Aman
931 views
0 votes
1 answer

Python error "TypeError: Cannot compare types 'ndarray(dtype=int64)' and 'str'"

Hey @Ashish, change the emotion_map to the ...READ MORE

May 30, 2019 in Python by Mir
8,312 views
0 votes
1 answer

How do I create a dataframe using a dictionary in pandas?

Hi @Hannah, You need to define your dictionary ...READ MORE

Nov 18, 2019 in Python by Eric
865 views
0 votes
1 answer

What kind of data suits pandas the most?

Pandas can handle almost all kinds of ...READ MORE

Nov 18, 2019 in Python by Eric
857 views
0 votes
1 answer

How to find path of Python interpreter?

In Python, the sys module has System-specific ...READ MORE

Jul 26, 2019 in Python by Arvind
• 3,050 points
5,780 views
0 votes
1 answer

Python error "ImportError: No module named pygame.locals"

You need to download and install the ...READ MORE

Jun 18, 2019 in Python by Greg
7,406 views
0 votes
1 answer

Difference between ElementTree and Minidom

Python allows parsing these XML documents using ...READ MORE

Jul 22, 2019 in Python by Wajiha
• 1,960 points
5,941 views
0 votes
1 answer

Open a file if it exists or create and open it does not exists - Python

You can use this: f = open("ex.txt","w+") Here the ...READ MORE

Jun 20, 2019 in Python by Jason
7,317 views
0 votes
1 answer

Python error "AttributeError: 'str' object has no attribute 'casefold'"

Check your python version. Casefold is possible ...READ MORE

Jul 4, 2019 in Python by Yesha
6,693 views
0 votes
0 answers

Python error "IndexError: list index out of range"

I am trying to execute the following ...READ MORE

Jun 17, 2019 in Python by Alok
7,459 views
0 votes
0 answers

Can not fetch data from Google fire store

i have https domain with django platfrom ...READ MORE

Nov 18, 2019 in Python by anonymous
• 120 points
773 views
0 votes
0 answers

Operands Could not be Broadcast with Shapes (19,)(0,) — KNN

I am working on how to use ...READ MORE

Nov 10, 2019 in Python by sam
• 120 points
1,152 views
0 votes
0 answers

How to save the import csv file to mongodb using pyspark (or python)?

I have this code, and I want ...READ MORE

Oct 9, 2019 in Python by Ahmed
• 310 points
2,499 views
0 votes
1 answer

What is the use of Tkinter,Flask and Django? What is the main use of them? Can any of them help me in freelancing?

Hey, all the tools that you have ...READ MORE

Feb 27, 2019 in Python by Priyaj
• 58,020 points
12,128 views
0 votes
1 answer

Check python object's data type

Hi @hannah, that's pretty simple. To check ...READ MORE

Nov 18, 2019 in Python by Eric
695 views
0 votes
2 answers

Django forms in ReactJs

Did you ever find a solution for ...READ MORE

Feb 6, 2020 in Python by martin
3,284 views