Most answered questions in Python

0 votes
1 answer

popen.communicate in Python

Your second bit of code starts the ...READ MORE

Nov 13, 2018 in Python by Priyaj
• 58,090 points
2,782 views
0 votes
1 answer

Sort Counter by value? - python

>>> x = Counter({'a':1, 'b':2, 'c':3}) >>> ...READ MORE

Nov 13, 2018 in Python by Priyaj
• 58,090 points
1,289 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
332 views
0 votes
1 answer

Difference between module and Package in Python

A module is basically a single file ...READ MORE

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

Shortest path from source to and from a negative cycle using Bellman Ford in Python

class NegativeWeightFinder: def __init__(self, graph: nx.Graph): ...READ MORE

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

What's the right way to concatenate files and appending the New Line character in Python? Text or binary mode?

It seems like you're using the wrong ...READ MORE

Nov 13, 2018 in Python by Anirudh
• 2,080 points

edited Dec 14, 2018 by Anirudh 1,269 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
505 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
528 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,090 points
484 views
0 votes
1 answer

Install PIP on Python 3.6

pip is bundled with Python > 3.4 On Unix-like ...READ MORE

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

Python and Anaconda

Read this article and you will get ...READ MORE

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

Know/change current directory in Python shell?

This will work  >>> import os >>> os.getcwd() '/home/user' >>> os.chdir("/tmp/") >>> ...READ MORE

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

What is logits, softmax and softmax_cross_entropy_with_logits in Python?

Suppose you have two tensors, where y_hat contains computed ...READ MORE

Nov 12, 2018 in Python by Nymeria
• 3,560 points
4,206 views
0 votes
1 answer

How to convert a Pandas GroupBy object to DataFrame in Python

g1 here is a DataFrame. It has a hierarchical index, ...READ MORE

Nov 12, 2018 in Python by Nymeria
• 3,560 points
34,114 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
656 views
0 votes
1 answer

Is there a stack/heap in Python?

Memory management in Python involves a private ...READ MORE

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

In NumPy how do I get the maximum of subsets? Python

You can use np.maximum.reduceat: >>> _, idx = np.unique(g, ...READ MORE

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

Pycharm warning: Must implement all abstract methods in Python. Why?

n vote As expected, python itself recognises that ...READ MORE

Nov 9, 2018 in Python by Nymeria
• 3,560 points
3,638 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
456 views
0 votes
1 answer

Increment with ++ in Python

Python doesn't support ++, so we use: number ...READ MORE

Nov 8, 2018 in Python by SDeb
• 13,300 points
3,751 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
585 views
0 votes
1 answer

Python socket.sendall() function working

socket_sendall clearly gives up once send() returns -1, ...READ MORE

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

How to activate virtualenv in Python? Help!

One major issue I see is that ...READ MORE

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

edited Dec 17, 2018 by Nymeria 4,274 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 404 views
0 votes
1 answer

Real-world examples of applications in python?

You can view this reference here: Python projects ...READ MORE

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

How to implement Queue in python

You are missing this  from queue import * This ...READ MORE

Nov 2, 2018 in Python by Nabarupa
2,588 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
534 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,090 points
466 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,090 points
870 views
0 votes
1 answer

What are namespaces in Python?

Namespace is basically a way to implement ...READ MORE

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

Meta classes in Python

A Metaclass is the class of a ...READ MORE

Oct 31, 2018 in Python by SDeb
• 13,300 points
389 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,080 points

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

kwargs in Python

kwargs in **kwargs is just variable name. You can very ...READ MORE

Oct 31, 2018 in Python by Priyaj
• 58,090 points
398 views
0 votes
1 answer

Open multiple files using with open() in Python?

Just replace and with , and you're done: with open('a', 'w') as ...READ MORE

Oct 31, 2018 in Python by Priyaj
• 58,090 points
8,350 views
0 votes
1 answer

Run python script on terminal (ubuntu)?

Your shell in the terminal has a concept ...READ MORE

Oct 31, 2018 in Python by Priyaj
• 58,090 points
4,597 views
0 votes
1 answer

How does slice notation in Python work?

The Python tutorial talks about it (scroll down a ...READ MORE

Oct 31, 2018 in Python by Priyaj
• 58,090 points
563 views
0 votes
1 answer

How to convert datetime.date to UTC timestamp in Python

In Python 3 (< 3.3) From the docs ...READ MORE

Oct 31, 2018 in Python by Priyaj
• 58,090 points
9,638 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,104 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,072 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
679 views
+1 vote
1 answer

Python: Print variable and string in same line

For a better understanding you can refer ...READ MORE

Oct 30, 2018 in Python by Priyaj
• 58,090 points
1,280 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,090 points
842 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,090 points
710 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,090 points
764 views
0 votes
1 answer

Difference between iterators & generators

iterator is a more general concept: any ...READ MORE

Oct 29, 2018 in Python by SDeb
• 13,300 points
2,809 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
779 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,090 points
812 views
0 votes
1 answer

Tips for debugging Python program?

Follow the documentation pn PDB here :-  PDB You ...READ MORE

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

Declare variable without assigning any value in Python?

var = None Python is dynamic, so you ...READ MORE

Oct 29, 2018 in Python by Priyaj
• 58,090 points
3,464 views
0 votes
1 answer

Multiprocessing queue in Python?

Here you can find a brief example ...READ MORE

Oct 29, 2018 in Python by Priyaj
• 58,090 points
2,672 views