Trending questions in Python

0 votes
1 answer

Python, mysqldb and unicode

What you get is a bytestring. You ...READ MORE

Aug 1 in Python by SDeb
• 13,160 points
9 views
0 votes
1 answer

Python: Both list gets affected after creating list using list2 = list1

When you are copying a list to ...READ MORE

Aug 1 in Python by Lohit
6 views
0 votes
0 answers
0 votes
1 answer

Installing package not found in conda

You can install pip in your conda env and then run pip ...READ MORE

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

How to distinguish between a variable and an identifier?

Key Differences between Identifier and Variable Both an ...READ MORE

Jul 31 in Python by Arvind
• 2,680 points
11 views
0 votes
1 answer

Web scraping problem

This is because many websites do not ...READ MORE

Jul 31 in Python by Wajiha
• 1,840 points
15 views
0 votes
1 answer

How do I set a Gtk.StatusIcon as Text?

I don't think that is possible. The ...READ MORE

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

reverse a list without built-in functions

You can do it in 2 ways: Using ...READ MORE

Jul 31 in Python by Wajiha
• 1,840 points
12 views
0 votes
1 answer

Python script to compare 2 files

Refer the given code and let us ...READ MORE

Jul 31 in Python by Arpit
9 views
0 votes
1 answer

How can I use python to execute a curl command?

For sake of simplicity, maybe you should ...READ MORE

Oct 11, 2018 in Python by charlie_brown
• 7,720 points
12,666 views
0 votes
1 answer

How to write a regular expression in Python?

The following code should be able to ...READ MORE

Jul 30 in Python by Arvind
• 2,680 points
22 views
0 votes
1 answer

How to check whether something is a variable or a function in Python?

Suppose you have a variable defined in ...READ MORE

Jul 30 in Python by Arvind
• 2,680 points
15 views
+1 vote
1 answer

Can assignment operator be used to copy elements in Python?

Yes assignment operator can be used to ...READ MORE

Jul 29 in Python by Neel
• 2,690 points

edited Jul 30 by Neel 17 views
0 votes
1 answer

Doubt in numpy.vstack

The vstack function in numpy will stack ...READ MORE

Jul 30 in Python by Esha
18 views
0 votes
1 answer

flush parameter of print in Python

Usually all I/Os are buffered, meaning they ...READ MORE

Jul 30 in Python by Wajiha
• 1,840 points
11 views
0 votes
0 answers

What is the type-error in python?

How to resolve this error, or keep ...READ MORE

Jul 31 in Python by Waseem
• 4,230 points
14 views
0 votes
0 answers

How to read data in a bubble sort algorithm in python?

I am not able to read the ...READ MORE

Jul 31 in Python by Waseem
• 4,230 points
13 views
0 votes
1 answer

Difference between end and sep

end and sep are optional parameters of ...READ MORE

Jul 30 in Python by Wajiha
• 1,840 points
8 views
0 votes
1 answer

How Do You Run A Python Script In Blender?

Blender is a free and open-source 3D ...READ MORE

Jul 30 in Python by Mohammad
• 3,060 points
26 views
+1 vote
1 answer

i still can't find http proxy in system setting

Could be because you don't have the ...READ MORE

Jul 29 in Python by Anvi
27 views
0 votes
1 answer

Is there a scanf() or sscanf() equivalent in python?

There is nothing as such for python. For ...READ MORE

Jul 29 in Python by Greg
15 views
0 votes
1 answer

Manually import module - python

I think the following should work: foo.py: from bar ...READ MORE

Jul 29 in Python by Jinu
13 views
0 votes
0 answers

How to calculate accuracy in a logistic regression model in python?

What accuracy score is considered a good ...READ MORE

Jul 30 in Python by Waseem
• 4,230 points
14 views
0 votes
1 answer

How do I find current module name in python?

A module can find out its own ...READ MORE

Jul 29 in Python by Simran
10 views
0 votes
0 answers

Is it ok to have multiple versions of anaconda installed on our systems?

I have both 2.7 and 3.5 installed ...READ MORE

Jul 30 in Python by Waseem
• 4,230 points
12 views
0 votes
1 answer

How do I specify hexadecimal and octal integers in Python?

To represent an octal integer, precede the octal ...READ MORE

Jul 29 in Python by Meg
10 views
0 votes
1 answer

What are the arguments of sorted() function in Python?

Sorted() sorts any sequence (list, tuple) and ...READ MORE

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

Connect to an URI in postgres

The connection string passed to psycopg2.connect is ...READ MORE

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

Ruby equivalent for Python's “try”?

Use this as an example: begin # ...READ MORE

Jul 29 in Python by SDeb
• 13,160 points
9 views
0 votes
0 answers

i would like assistance on my code after i input: y = data.temp x = data.drop('temp', axis=1)

This error appeared:      Traceback (most recent call ...READ MORE

Jul 30 in Python by mimo
19 views
0 votes
0 answers

Why does -22 // 10 return -3? - Python

Why does -22 // 10 return -3 ...READ MORE

Jul 29 in Python by Ashish
14 views
0 votes
0 answers

How do you wrap a c++ class in python using SWIG?

What is SWIG? Is there a library ...READ MORE

Jul 29 in Python by Waseem
• 4,230 points
15 views
0 votes
1 answer

What is the key difference between self in ruby and self in python?

Ruby and Python are actually very different languages (although ...READ MORE

Jul 30 in Python by Mohammad
• 3,060 points
14 views
0 votes
2 answers

Python error "ERROR: Could not find a version that satisfies the requirement PyQt4 (from versions: none)"

You cannot install PyQt directly from pip. ...READ MORE

Jul 22 in Python by Bob
237 views
0 votes
1 answer

How can you configure python on eclipse?

Install the PyDev plug-in for Eclipse Launch Eclipse. Configure PyDev. Python must be installed to configure PyDev. ...READ MORE

Jul 30 in Python by Mohammad
• 3,060 points
9 views
0 votes
1 answer

What is the python logic to check if a number is armstrong number or not?

number = int(input("enter a number")) s = 0 temp ...READ MORE

Jul 30 in Python by Mohammad
• 3,060 points
16 views
0 votes
1 answer

How to define a class in python?

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

Jul 30 in Python by Mohammad
• 3,060 points
13 views
0 votes
1 answer

How do you read from a file using file handling in python?

To read from a file you can ...READ MORE

Jul 30 in Python by Mohammad
• 3,060 points
24 views
0 votes
1 answer

What is memoryview in Python 3?

Before we get into what memory views ...READ MORE

Jul 26 in Python by Arvind
• 2,680 points
22 views
0 votes
1 answer

Using filter() and map() together

You are not providing the parameters in ...READ MORE

Jul 26 in Python by Wajiha
• 1,840 points
14 views
0 votes
1 answer
0 votes
1 answer

Suing multiple lambda functions together

Yes, lambda functions can be used within ...READ MORE

Jul 26 in Python by Wajiha
• 1,840 points
12 views
0 votes
1 answer

Run a function after keyboard interrupt in python

Below is the code to run a ...READ MORE

Jul 26 in Python by Shri
18 views
0 votes
1 answer

NumPy Array Indexing

If you want to create a subarray ...READ MORE

Jul 26 in Python by SDeb
• 13,160 points
19 views
0 votes
1 answer

heapify returns NoneType

The heapify() method transforms the list in-place. This means ...READ MORE

Jul 26 in Python by SDeb
• 13,160 points
15 views
0 votes
1 answer

How to find runtime complexity of funtions that use list in Python?

The Average Case assumes parameters generated uniformly ...READ MORE

Jul 26 in Python by Arvind
• 2,680 points
12 views
0 votes
1 answer

How to find path of Python interpreter?

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

Jul 26 in Python by Arvind
• 2,680 points
10 views
0 votes
1 answer

How to use Python notebooks using Python 3?

This can be done using following steps ...READ MORE

Jul 26 in Python by Arvind
• 2,680 points
9 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 in Python by Jimmy
39 views
0 votes
1 answer

sklearn.cross_validation import train_test_split not working

cross_validation is not a part of sklearn ...READ MORE

Jul 25 in Python by Sharan
23 views