Trending questions in Python

0 votes
2 answers

How to check whether a string contains alphabets or number in Python?

By using isAlpha () to check whether ...READ MORE

Jul 13 in Python by Sheik janibasha
48 views
0 votes
0 answers

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

for i in cnames:     print(i)     df_csv[i] = (df_csv[i] - ...READ MORE

Jul 14 in Python by anonymous
60 views
0 votes
1 answer

How to draw a tic tac toe board in python?

Following is a code to draw a ...READ MORE

Jul 31 in Python by Mohammad
• 3,060 points
34 views
0 votes
1 answer

Python: Megre multiple dataframes into single data frame

You can merge the data frame using ...READ MORE

Jul 14 in Python by Sharan
26 views
0 votes
1 answer

How to resolve the error while importing cv2 from openCV in python?

I would recommend you go with anaconda ...READ MORE

Jul 31 in Python by Mohammad
• 3,060 points
25 views
0 votes
1 answer

How to compare expected and predicted values?

The predict() function returns a plain numpy ...READ MORE

Jul 13 in Python by Tina
14 views
0 votes
1 answer

How to resolve the typeerror in python os module?

TypeError - because the argument doesn't have ...READ MORE

Jul 31 in Python by Mohammad
• 3,060 points
21 views
0 votes
1 answer

What is the patterns package in python used for?

Pattern is a web mining tool in ...READ MORE

Jul 31 in Python by Mohammad
• 3,060 points
21 views
0 votes
1 answer

Python: UnicodeDecodeError: "utf-8" codec can"t decode byte 0xa0 in position 10: invalid start byte

You have to use the encoding as latin1 ...READ MORE

Jul 11 in Python by Ritu
75 views
0 votes
1 answer

How does garbage collection happen in Python?

The Garbage collection runs automatically as the ...READ MORE

Jul 12 in Python by Arvind
• 2,600 points
27 views
0 votes
1 answer

Cherrypy vs. Apache/mod_wsgi

In my experience the best performance is ...READ MORE

Jul 12 in Python by SDeb
• 13,160 points
24 views
0 votes
1 answer

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

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

Jul 8 in Python by SDeb
• 13,160 points
192 views
0 votes
1 answer

Finding local IP addresses using Python's stdlib

import socket socket.gethostbyname(socket.gethostname()) This won't work always (returns 127.0.0.1 on machines ...READ MORE

Jul 12 in Python by SDeb
• 13,160 points
20 views
0 votes
1 answer

How to get permutations of list or a set in Python?

Permutation is an arrangement of objects in ...READ MORE

Jul 11 in Python by Neel
• 2,450 points
29 views
0 votes
1 answer

What are generators in Python?

There are two terms involved when we ...READ MORE

Jul 11 in Python by Neel
• 2,450 points
15 views
0 votes
1 answer

How to input optional arguments in python command line?

Please use this code. if len(sys.argv) == 2: first_log ...READ MORE

Jul 11 in Python by Suri
10 views
0 votes
1 answer

Python: How to find dimensions of the image?

You can use the Pillow package here, ...READ MORE

Jul 11 in Python by Likith
13 views
0 votes
1 answer

How to install django 1.4?

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

Jul 11 in Python by SDeb
• 13,160 points
14 views
0 votes
1 answer

Animated sprite from few images

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

Jul 11 in Python by SDeb
• 13,160 points
10 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 in Python by Jinu
248 views
0 votes
1 answer

Python: convert string to unicode

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

Jul 10 in Python by Olivia
25 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 in Python by Cherukuri
• 19,950 points
34 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 in Python by Arvind
• 2,600 points
18 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 in Python by marceepoo
• 130 points

edited Jul 22 by Kalgi 28 views
0 votes
1 answer

How to lock a thread in Python?

Please refer to the following code to ...READ MORE

Jul 10 in Python by Arvind
• 2,600 points
16 views
0 votes
1 answer

Run two functions at different times

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

Jul 10 in Python by Rasheed
15 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 in Python by JTM
91 views
0 votes
1 answer

hclust size limit?

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

Jul 10 in Python by SDeb
• 13,160 points
18 views
0 votes
1 answer

Persisting data in sklearn

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

Jul 10 in Python by SDeb
• 13,160 points
16 views
0 votes
1 answer

What is setup.py in Python?

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

Jul 10 in Python by Neel
• 2,450 points
21 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 in Python by SDeb
• 13,160 points
50 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 in Python by Neel
• 2,450 points
15 views
0 votes
1 answer

time.sleep() in Python

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

Jul 9 in Python by Wajiha
• 1,840 points
22 views
0 votes
1 answer

Python table gives NaN when initialized with series

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

Jul 9 in Python by Yogi
21 views
0 votes
1 answer

yield keyword in Python

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

Jul 9 in Python by Wajiha
• 1,840 points
19 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 in Python by Arvind
• 2,600 points
54 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 in Python by SDeb
• 13,160 points
20 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 8 in Python by Pallavi
46 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 in Python by Arvind
• 2,600 points
43 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 in Python by Mohammad
• 3,060 points
29 views
0 votes
1 answer

Create a circle turtle - Python

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

Jul 8 in Python by Manasa
19 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 in Python by Rajeev
29 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 in Python by Ayushi
19 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 in Python by Jinu
17 views
0 votes
1 answer

convert a SAS datetime in Pandas

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

Jul 8 in Python by SDeb
• 13,160 points
21 views
0 votes
0 answers
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 in Python by Sakshi
28 views
0 votes
1 answer

Pandas - FillNa with another column

You can provide this column to fillna, it ...READ MORE

Jul 5 in Python by SDeb
• 13,160 points
121 views
0 votes
0 answers

How do you parse a string in python?

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

Jul 8 in Python by Waseem
• 4,200 points
17 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 in Python by Yesha
145 views