Trending questions in Python

0 votes
1 answer

Multi-threading program in python

import threading import os def task1(): print("Task 1 assigned ...READ MORE

Feb 7, 2019 in Python by Omkar
• 69,210 points
571 views
–1 vote
1 answer

Python pandas axis error

When you are applying sum() you don't ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,210 points
1,865 views
0 votes
1 answer

Why are dictionary objects unhashable in Python?

Hi, it is not possible to hash ...READ MORE

Feb 8, 2019 in Python by Nymeria
• 3,560 points
484 views
0 votes
1 answer

Need help displaying complete output in Jupyter rather than just last result set in Python

Hi, the solution to this is very ...READ MORE

Jan 28, 2019 in Python by Nymeria
• 3,560 points
956 views
0 votes
1 answer

Shuffling a Word

You can try the following: import random word = ...READ MORE

Jan 30, 2019 in Python by SDeb
• 13,300 points
814 views
+2 votes
1 answer

“OSError: Unable to open file (bad superblock version number)" in python h5py file read

File could indeed be opened on Linux ...READ MORE

Sep 26, 2018 in Python by Priyaj
• 58,090 points
6,171 views
0 votes
1 answer

How to use HashMap in Python?

You can use Python dictionary it is a built-in type ...READ MORE

Oct 26, 2018 in Python by Priyaj
• 58,090 points
4,951 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,205 views
0 votes
1 answer

How to set a random seed for prn generation?

The main python module that is run ...READ MORE

Feb 4, 2019 in Python by charlie_brown
• 7,720 points
557 views
0 votes
1 answer

Need help with custom authentication in the Google App Engine using Python

Good question. Django 1.0 was updated recently ...READ MORE

Jan 21, 2019 in Python by Nymeria
• 3,560 points
1,171 views
0 votes
1 answer

How to list files/directories in python

You can use the os module to list the ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,210 points
558 views
0 votes
2 answers

In List of Dicts, find min() value of a common Dict field

lst = [{'price': 99, 'barcode': '2342355'}, {'price': ...READ MORE

Aug 31, 2018 in Python by Omkar
• 69,210 points
7,289 views
+1 vote
1 answer

What does the Raise keyword do in Python?

Hi! I think I can answer this - ...READ MORE

Jan 25, 2019 in Python by Nymeria
• 3,560 points
895 views
0 votes
1 answer

Can someone help me understand timedelta in Python?

Because timedelta is defined like: class datetime.timedelta([days,] [seconds,] ...READ MORE

Jan 16, 2019 in Python by charlie_brown
• 7,720 points
1,317 views
0 votes
1 answer

Python if not == vs if !=

Using dis to look at the bytecode ...READ MORE

Jan 29, 2019 in Python by SDeb
• 13,300 points
780 views
0 votes
1 answer

Weird closure behavior in python

Closures don't refer to variables but rather ...READ MORE

Feb 2, 2019 in Python by SDeb
• 13,300 points
592 views
0 votes
1 answer

Command history in interactive Python

You can use the following to get ...READ MORE

Nov 27, 2018 in Python by SDeb
• 13,300 points
3,439 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

Convert the keys of a dictionary to list

Unpacking with * works with any object ...READ MORE

Feb 7, 2019 in Python by Omkar
• 69,210 points
338 views
+2 votes
2 answers

Job roles for Python

Hey, Python Developer responsibilities include writing and testing ...READ MORE

May 16, 2019 in Python by Gitika
• 65,910 points
943 views
0 votes
1 answer

How to list only files in a directory?

Before printing, you can use a check ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,210 points
421 views
0 votes
1 answer

How to convert string into epoch time?

you are passing the parsed datetime object to ...READ MORE

Sep 22, 2018 in Python by SDeb
• 13,300 points
6,244 views
0 votes
1 answer

Error Code installing Scrapy

You can install it via pip wheel. Download ...READ MORE

Jan 17, 2019 in Python by SDeb
• 13,300 points
1,157 views
0 votes
1 answer

Get path from open file in Python

The key here is the name attribute ...READ MORE

Jan 16, 2019 in Python by SDeb
• 13,300 points
1,186 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,272 views
0 votes
1 answer

Cursor Position in Python

You can use the following to retrieve ...READ MORE

Dec 11, 2018 in Python by SDeb
• 13,300 points
2,731 views
0 votes
1 answer

Need help with Django URL string parameter pattern in Python

Good question. The solution to this short ...READ MORE

Jan 28, 2019 in Python by Nymeria
• 3,560 points
621 views
0 votes
1 answer

Need help referencing Python Package when the filename consists of a period key

Hi, it's a very simple answer actually.  You ...READ MORE

Jan 25, 2019 in Python by Nymeria
• 3,560 points
731 views
0 votes
1 answer

How to find packages installed using pip?

Yes, you can find the packages installed ...READ MORE

Jan 29, 2019 in Python by Omkar
• 69,210 points
479 views
0 votes
1 answer

Issue creating S3 Bucket Python

Hello @Suraj, There is an indentation issue, >>> ...READ MORE

Jan 18, 2019 in Python by Priyaj
• 58,090 points
953 views
0 votes
1 answer

Python logical operator 'and'

If you use and on two or ...READ MORE

Jan 28, 2019 in Python by Omkar
• 69,210 points
512 views
–1 vote
1 answer

Python change directory error

The syntax of the command you are ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,210 points
1,416 views
0 votes
1 answer

How can I prevent or alter access to class variables in Python?

The ActiveState solution that Pynt references makes instances of ...READ MORE

Dec 5, 2018 in Python by aryya
• 7,450 points
2,830 views
0 votes
1 answer

df.mul vs df.rmul in Pandas

The documentation is not identical. As stated ...READ MORE

Jan 18, 2019 in Python by SDeb
• 13,300 points
913 views
0 votes
1 answer

How to use an index to get an item?

What you show, ('A','B','C','D','E'), is not a ...READ MORE

Jan 30, 2019 in Python by SDeb
• 13,300 points
389 views
0 votes
1 answer

Python Linked List

Check out the following code. This might ...READ MORE

Jan 29, 2019 in Python by SDeb
• 13,300 points
455 views
0 votes
1 answer

Why does the AttributeError occur?

This happens because the scipy module doesn't ...READ MORE

Dec 4, 2018 in Python by SDeb
• 13,300 points
2,798 views
+6 votes
4 answers

Python and Pygame: Difference

Python is a programming language. PyGame is a ...READ MORE

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

Can I configure Django runserver to reload when static or non-python files are changed?

There is no need to reload server, ...READ MORE

Sep 4, 2018 in Python by Priyaj
• 58,090 points
6,711 views
0 votes
1 answer

Linter Pylint not installed

Try the following steps: 1. Open a terminal ...READ MORE

Dec 11, 2018 in Python by SDeb
• 13,300 points
2,439 views
0 votes
1 answer

How to calculate time interval between two time strings in Python

Try doing this - It is efficient for ...READ MORE

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

edited Dec 11, 2018 by Nymeria 2,947 views
0 votes
1 answer

I am using a built-in function name as a method identifier and sometimes as an attribute in Python, is this bad?

Hi, good question. The thing is that ...READ MORE

Jan 23, 2019 in Python by Nymeria
• 3,560 points
566 views
0 votes
1 answer

Which are the tools which can be used to produce documentation for a REST API automatically using Python in Flask?

Hi, good question. There is a module meant ...READ MORE

Jan 14, 2019 in Python by Nymeria
• 3,560 points
929 views
0 votes
1 answer

Need help using Joins in Pandas using Python

Hi, there is one scenario where the ...READ MORE

Jan 24, 2019 in Python by Nymeria
• 3,560 points
454 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
+3 votes
2 answers

how to print array integer without [] bracket in python like result = 1,2,3,4,5

Hey @abhijmr.143, you can print array integers ...READ MORE

Aug 5, 2018 in Python by Omkar
• 69,210 points

edited Aug 8, 2018 by Omkar 7,697 views
0 votes
1 answer

Using list comprehension how to call list of function

For the class method when used as ...READ MORE

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

difference between "*" and "**"

The "**" operator is used for 'power ...READ MORE

Nov 19, 2018 in Python by SDeb
• 13,300 points
3,261 views
0 votes
1 answer

Need help with Python Text-to-Speech usage

Hi. Just before I begin my answer I ...READ MORE

Jan 16, 2019 in Python by Nymeria
• 3,560 points
744 views
0 votes
1 answer

How to get textual output when using exceptions in Python?

Hi, the answer is pretty simple.  Without the ...READ MORE

Jan 17, 2019 in Python by Nymeria
• 3,560 points
699 views