Trending questions in Python

+2 votes
2 answers

Error while printing hello world in python.

You must be trying this command in ...READ MORE

Mar 31, 2018 in Python by GandalfDwhite
• 1,320 points
6,409 views
0 votes
1 answer

How do I generate some random numbers with a distribution using Python?

scipy.stats.rv_discrete is what you ned IMHO. You can supply ...READ MORE

Oct 31, 2018 in Python by Anirudh
• 2,090 points

edited Dec 14, 2018 by Anirudh 1,479 views
0 votes
1 answer

Open file in Python

There is this code I used for ...READ MORE

Nov 16, 2018 in Python by Jino
• 5,820 points
791 views
0 votes
1 answer

% operator in Python

When you use '(%g,%g)', it is the ...READ MORE

Nov 12, 2018 in Python by ana1504.k
• 7,910 points
926 views
0 votes
1 answer

Reverse a string in Python

>>> 'hello world'[::-1] 'dlrow olleh' This is extended slice syntax. Syntax is ...READ MORE

Nov 16, 2018 in Python by findingbugs
• 3,260 points
758 views
0 votes
1 answer

Using Python what kind of applications can be built?

http://en.wikipedia.org/wiki/List_of_Python_software  follow the link and You will see ...READ MORE

Nov 14, 2018 in Python by Theodor
• 740 points
841 views
0 votes
1 answer

Python: Module vs package?

A package is represented by an imported ...READ MORE

Nov 13, 2018 in Python by Priyaj
• 58,020 points
866 views
0 votes
1 answer

Connect to a MySQL using Python?

Very similar to mysqldb but better than ...READ MORE

Nov 16, 2018 in Python by Jino
• 5,820 points
728 views
+1 vote
1 answer

Understanding Python super() with __init__() methods

It's been noted that in Python 3.0+ ...READ MORE

Aug 28, 2018 in Python by Priyaj
• 58,020 points
4,131 views
0 votes
1 answer

How to round a floating point number up to certain decimal place in Python?

This is normal (and has nothing to do ...READ MORE

Oct 8, 2018 in Python by charlie_brown
• 7,720 points
2,364 views
0 votes
1 answer

How to read Excel File in Python

With pandas it is possible to get ...READ MORE

Oct 22, 2018 in Python by Priyaj
• 58,020 points
1,739 views
0 votes
1 answer

Set of modules in Python

NumPy, SciPy, psutil, Matplotlib modules are supported. ...READ MORE

Nov 14, 2018 in Python by SDeb
• 13,300 points
716 views
0 votes
1 answer

How to Convert usual text to executable machine code in python

what you are looking for is a ...READ MORE

Oct 1, 2018 in Python by Priyaj
• 58,020 points
2,609 views
0 votes
1 answer

How to Parse values from a JSON file?

import json from pprint import pprint with open('data.json') as ...READ MORE

Oct 15, 2018 in Python by Priyaj
• 58,020 points
2,001 views
0 votes
1 answer

Python and Anaconda

Anaconda is a freemium open source distribution of: Python and ...READ MORE

Nov 12, 2018 in Python by Priyaj
• 58,020 points
785 views
0 votes
1 answer

Using filter, map, and reduce in Python

A quick implementation might look like this: from ...READ MORE

Nov 2, 2018 in Python by Priyaj
• 58,020 points
1,215 views
0 votes
1 answer

Best library for reading meta-data

You can use PowerShell to implement ID3 ...READ MORE

Oct 31, 2018 in Python by nirvana
• 3,130 points
1,308 views
0 votes
1 answer

Power Math in Python

When you use "^" operator, it is ...READ MORE

Nov 12, 2018 in Python by ana1504.k
• 7,910 points
750 views
0 votes
2 answers

Indentation Error in Python

Use tabs instead of spaces. This is ...READ MORE

Feb 15, 2019 in Python by Shashank
• 1,370 points
883 views
0 votes
1 answer

When to use file vs open in Python?

File() has been removed since Python 3.0 ...READ MORE

Oct 30, 2018 in Python by SDeb
• 13,300 points
1,266 views
0 votes
1 answer

Python: Glob() to find files recursively

import os, fnmatch def find_files(directory, pattern): ...READ MORE

Oct 24, 2018 in Python by Priyaj
• 58,020 points
1,527 views
0 votes
1 answer

Meaning of -> in Python

It's a function annotation. In more detail, Python 2.x ...READ MORE

Nov 12, 2018 in Python by Priyaj
• 58,020 points
690 views
0 votes
1 answer

Limit max RAM consumption for a application

Using Job Objects. First you need to ...READ MORE

Nov 15, 2018 in Python by findingbugs
• 3,260 points
563 views
0 votes
1 answer

Google PubSub Subscription cannot recover from StatusCode.UNAVAILABLE [code=8a75] error

I'm seeing similar behavior as you. Except ...READ MORE

Oct 5, 2018 in Python by Priyaj
• 58,020 points
2,322 views
0 votes
1 answer

Lazy loading of columns in sqlalchemy python

class Book(Base): __tablename__ = ...READ MORE

Nov 8, 2018 in Python by Nymeria
• 3,560 points
822 views
0 votes
1 answer

What is GIL in CPython?

Python's GIL is intended to serialize access ...READ MORE

Nov 9, 2018 in Python by SDeb
• 13,300 points
761 views
0 votes
1 answer

Applications built using Python

Python is suitable for almost all possible ...READ MORE

Nov 13, 2018 in Python by SDeb
• 13,300 points
538 views
+1 vote
1 answer

Implement Quicksort in Python

This will help you. def sort(array=[2,5,1,6,9,8,7,10,21,12]): ...READ MORE

Oct 30, 2018 in Python by Priyaj
• 58,020 points
1,082 views
0 votes
2 answers

What are the types of dictionary in python?

There are 4 types of dictionary Empty Integer Mixed Dictionary with ...READ MORE

Feb 14, 2019 in Python by Shashank
• 1,370 points
1,023 views
0 votes
1 answer

Avoiding multiple nested for-loops in python

You can replace the three loops with: from ...READ MORE

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

Measuring the distance between pixels on OpenCv with Python

Assuming input frames will have "close to ...READ MORE

Sep 21, 2018 in Python by Priyaj
• 58,020 points
2,734 views
0 votes
1 answer

Search help using Python Console

The pydoc -k flag searches the documentation. pydoc ...READ MORE

Nov 8, 2018 in Python by SDeb
• 13,300 points
621 views
0 votes
1 answer

Create a nested directory in Python

Try os.path.exists, and consider os.makedirs for the ...READ MORE

Oct 16, 2018 in Python by SDeb
• 13,300 points
1,605 views
0 votes
1 answer

Speech Recognition and Python

you can use https://pypi.python.org/pypi/pygsr $> pip install pygsr example ...READ MORE

Oct 29, 2018 in Python by SDeb
• 13,300 points
1,024 views
0 votes
1 answer

How can I read Piano notes on Python?

First of all you need to find ...READ MORE

Sep 11, 2018 in Python by charlie_brown
• 7,720 points
3,194 views
0 votes
1 answer

Install Python packages on Windows?

First, pip is preferred over easy_install.  Then follow these steps to ...READ MORE

Oct 29, 2018 in Python by Priyaj
• 58,020 points
991 views
0 votes
1 answer

Restart python script automatically even when it crashes in Linux

Maybe this would be more robust? 1) save ...READ MORE

Sep 11, 2018 in Python by Priyaj
• 58,020 points
3,062 views
0 votes
1 answer

Why is Python scoping made the way it is?

The likeliest answer is that it just ...READ MORE

Nov 5, 2018 in Python by Nymeria
• 3,560 points

edited Dec 17, 2018 by Nymeria 681 views
+1 vote
1 answer

How is raw_input() and input() in python3.x?

raw_input() was renamed to input() so now input() returns the exact string ...READ MORE

Oct 30, 2018 in Python by Priyaj
• 58,020 points
899 views
0 votes
1 answer

What is the fucntion of mkdir -p in Python

mkdir -p gives you an error if the ...READ MORE

Oct 30, 2018 in Python by Priyaj
• 58,020 points
935 views
0 votes
1 answer

“stub” __objclass__ in a Python class how to implement it?

You want to avoid interfering with this ...READ MORE

Sep 27, 2018 in Python by Priyaj
• 58,020 points
2,357 views
0 votes
1 answer

How can I Iterate over dictionaries using 'for' loops

key is just a variable name. for key in ...READ MORE

Oct 17, 2018 in Python by Priyaj
• 58,020 points
1,485 views
+7 votes
2 answers

I want to build a recommender system incorporating diversity and accuracy in the recommender engine.

I dont know what exactly you are ...READ MORE

Sep 24, 2018 in Python by slayer
• 29,370 points
2,127 views
0 votes
1 answer

boolean in Python

True ... and False obviously. checker = None # not necessary if ...READ MORE

Nov 2, 2018 in Python by Priyaj
• 58,020 points
790 views
0 votes
1 answer

How are Python and Anaconda Related?

Anaconda is a free and open-source Python ...READ MORE

Oct 30, 2018 in Python by SDeb
• 13,300 points
890 views
0 votes
1 answer

In Python, how do I read a file line-by-line into a list?

with open(fname) as f:     content = f.readlines() # you ...READ MORE

Oct 9, 2018 in Python by SDeb
• 13,300 points
1,800 views
0 votes
1 answer

How to implement Linked List in Python?

You can use Deque that works better than linked list ...READ MORE

Oct 26, 2018 in Python by Priyaj
• 58,020 points
1,056 views
0 votes
1 answer

How to sort dictionary by value python

This would work: d = sorted(data, key = ...READ MORE

Nov 2, 2018 in Python by Nabarupa
723 views
0 votes
1 answer

Is there a way of using .lower more effectively in tkinter?

Here is a simple function and some ...READ MORE

Sep 25, 2018 in Python by Priyaj
• 58,020 points
2,353 views
0 votes
2 answers

How do I copy a file in python?

copy a file in python  from shutil ...READ MORE

Mar 27, 2019 in Python by rajesh
• 1,270 points
1,315 views