Latest questions in Python

0 votes
1 answer

How can I make a variable private in python?

Python does not have any private variables like C++ or ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
627 views
0 votes
1 answer

How do i kill a thread in python?

In Python, you simply cannot kill a Thread directly. If ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
753 views
0 votes
1 answer

Animated sprite from few images

You could try modifying your sprite so ...READ MORE

Jul 11, 2019 in Python by SDeb
• 13,300 points
563 views
0 votes
1 answer

How to install django 1.4?

This can be done by using this ...READ MORE

Jul 11, 2019 in Python by SDeb
• 13,300 points
710 views
+4 votes
3 answers

Write a for loop that prints all elements of a list and their position in the list. a = [4,7,3,2,5,9]

Try using this question by list comprehension: a=[4,7,3,2,5,9] print([x for ...READ MORE

Dec 9, 2019 in Python by vinaykumar
• 200 points
34,033 views
0 votes
1 answer

Python: convert string to unicode

Suppose you have a string in ASCII form ...READ MORE

Jul 10, 2019 in Python by Olivia
1,408 views
0 votes
1 answer

Run two functions at different times

Please refer the below code for your ...READ MORE

Jul 10, 2019 in Python by Rasheed
1,456 views
0 votes
2 answers

How to lock a thread in Python?

Lock objects can release the lock at ...READ MORE

Jul 23, 2020 in Python by sahil
• 580 points
709 views
0 votes
1 answer

is it possible to create zip of a directory in Python?

Please go through this code. This should ...READ MORE

Jul 10, 2019 in Python by Arvind
• 3,040 points
662 views
0 votes
1 answer

What are the key differences between python and java?

There are a lot of pressing  topics ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
507 views
0 votes
1 answer

How to install openssl in python?

pip install openssl-python run this command in the ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
8,116 views
0 votes
1 answer

hclust size limit?

Classic hierarchical clustering approaches are O(n^3) in ...READ MORE

Jul 10, 2019 in Python by SDeb
• 13,300 points
491 views
0 votes
1 answer

Persisting data in sklearn

If you want to find some fixed ...READ MORE

Jul 10, 2019 in Python by SDeb
• 13,300 points
608 views
+1 vote
0 answers

How to close a window, and then reinitialize it using PyQt

There is a button "btn_closeWin_and_reinit"  in the ...READ MORE

Jul 10, 2019 in Python by marceepoo
• 130 points

edited Jul 22, 2019 by Kalgi 7,051 views
0 votes
1 answer

How to have values from a List1 into Columns Names and List 2 Values as Index for an Empty DataFrame

Try like this, it will give you ...READ MORE

Jul 10, 2019 in Python by Cherukuri
• 33,030 points
801 views
0 votes
1 answer

What is setup.py in Python?

Suppose you want to install a module ...READ MORE

Jul 10, 2019 in Python by Neel
• 3,020 points
705 views
0 votes
1 answer

How to approach the problem of finding the nearest square?

The following method should solve this.  def nearest_square(limit): ...READ MORE

Jul 10, 2019 in Python by Neel
• 3,020 points
592 views
0 votes
0 answers

Python error "only size-1 arrays can be converted to Python scalars"

I'm trying to plot the exponential and ...READ MORE

Jul 9, 2019 in Python by JTM
1,606 views
0 votes
1 answer

Python table gives NaN when initialized with series

The NaN value you are getting is ...READ MORE

Jul 9, 2019 in Python by Yogi
1,158 views
0 votes
1 answer

yield keyword in Python

The yield keyword is used along with ...READ MORE

Jul 9, 2019 in Python by Wajiha
• 1,950 points
536 views
0 votes
1 answer

time.sleep() in Python

Sleep function plays a very important role ...READ MORE

Jul 9, 2019 in Python by Wajiha
• 1,950 points
366 views
0 votes
1 answer

What is list comprehension?

List comprehensions are used for creating new list from another ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
1,023 views
0 votes
1 answer

How do you break out of a while loop in python?

Usually the execution moves out of the ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
699 views
0 votes
1 answer

better way to drop nan rows in pandas

Use dropna: dat.dropna() You can pass param how to drop if all ...READ MORE

Jul 9, 2019 in Python by SDeb
• 13,300 points
4,338 views
0 votes
1 answer

Splitting a column with multiple values in python

Try using the following: df['id'] = df.index+1 df.set_index('id').col_name.str.split(',', expand ...READ MORE

Jul 9, 2019 in Python by SDeb
• 13,300 points
3,109 views
0 votes
1 answer

Python error "'str' object has no attribute 'turtle' in Python turtle"

There is a syntax error. Change the ...READ MORE

Jul 9, 2019 in Python by Pallavi
7,124 views
0 votes
0 answers

How i can print and count all the all element when i search like " Automation step by step" in Google using python selenium

I am trying to count all the ...READ MORE

Jul 9, 2019 in Python by anonymous
• 120 points
1,750 views
0 votes
1 answer

Create a circle turtle - Python

Hey its pretty simple. Try this out: food ...READ MORE

Jul 8, 2019 in Python by Manasa
781 views
0 votes
1 answer

Make turtle face a particular direction in python

You can use the the setheading command turtle.setheading(<degrees/radians>) In ...READ MORE

Jul 8, 2019 in Python by Jinu
3,828 views
0 votes
1 answer

How do I make one turtle follow another turtle in python?

Try something like this: from turtle import Turtle, ...READ MORE

Jul 8, 2019 in Python by Ayushi
4,807 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,040 points
6,458 views
0 votes
1 answer

What is the difference between str() and repr() functions in Python?

str() is mostly used to create output ...READ MORE

Jul 8, 2019 in Python by Arvind
• 3,040 points
1,422 views
0 votes
0 answers

How do you parse a string in python?

After splitting the string, how does parsing ...READ MORE

Jul 8, 2019 in Python by Waseem
• 4,540 points
566 views
0 votes
1 answer

How do you write a loop in python with conditional statements in python?

Lets say we have a problem statement ...READ MORE

Jul 8, 2019 in Python by Mohammad
• 3,230 points
784 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,403 views
0 votes
3 answers

How to replace negative numbers in Pandas Data Frame by zero?

 If all your columns are numeric, you ...READ MORE

Dec 16, 2020 in Python by Rajiv
• 8,910 points
43,352 views
0 votes
1 answer

convert a SAS datetime in Pandas

SAS date value is a value that ...READ MORE

Jul 8, 2019 in Python by SDeb
• 13,300 points
2,892 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,175 views
0 votes
1 answer

draw polygon based on user input - turtle python

Try something like this: import turtle # create a ...READ MORE

Jul 6, 2019 in Python by Umer
9,034 views
0 votes
1 answer

How do I draw a semi-circle only using turtle - Python

Try this: import turtle turtle = turtle.Pen() turtle.left(90) for x in ...READ MORE

Jul 6, 2019 in Python by Bheem
9,557 views
+1 vote
1 answer

How to save a bitmap or vector graphics image after creating a drawing with python's turtle module.

This worked for me: from Tkinter import * from ...READ MORE

Jul 6, 2019 in Python by Kyraa
7,508 views
0 votes
1 answer

python - get the root from tkinter for turtle

Hey @Haseeb, try something like this: import turtle canvas ...READ MORE

Jul 6, 2019 in Python by Barbara
729 views
0 votes
1 answer

Python error "SyntaxError: invalid syntax"

but i m getting this ouput: Enter the ...READ MORE

Mar 20, 2020 in Python by anonymous
8,093 views
0 votes
1 answer

Move turtle using the arrow keys in Python

You can use something like this: wn.onkey(move_up, 'Up') wn.onkey(move_left, ...READ MORE

Jul 6, 2019 in Python by Travis
2,993 views
0 votes
1 answer

Python error "IndexError: Cannot choose from an empty sequence"

Hi @Isha, According to your error  File ...READ MORE

Jul 5, 2019 in Python by Patric
5,281 views
0 votes
1 answer

Python error "TypeError: string indices must be integers, not str"

Hey @Dipti email_s.append(email_1["email_address"]) This is the list on ...READ MORE

Jul 5, 2019 in Python by Jinu
22,718 views
0 votes
1 answer

How to install biopython module in python?

To install biopython on your project, simply ...READ MORE

Jul 8, 2019 in Python by Mohammad
• 3,230 points
1,447 views
0 votes
1 answer

Purpose of fit method in sklearn module in python?

it basically trains your model using the ...READ MORE

May 14, 2020 in Python by Mahesh
• 140 points
3,213 views
0 votes
1 answer

Which is a good python ide for android devices?

I will suggest you to go for ...READ MORE

Jul 5, 2019 in Python by Neel
• 3,020 points
2,696 views
0 votes
1 answer

How to install and use myql connector in Python?

You can use pip to search if ...READ MORE

Jul 5, 2019 in Python by Neel
• 3,020 points
1,300 views