Trending questions in Python

–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,220 points
2,108 views
0 votes
0 answers
0 votes
1 answer

How to solve indentation in the below code?

Python does not use brackets, it uses ...READ MORE

Feb 9, 2019 in Python by Omkar
• 69,220 points
677 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,538 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
1,185 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
707 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
1,056 views
0 votes
0 answers

how to get mongoengine object id in flask program

i am using mongoengine to integrate with ...READ MORE

Oct 5, 2018 in Python by eatcodesleeprepeat
• 4,710 points
6,153 views
0 votes
1 answer

Number of private variables in class

In Python, there is no existence of ...READ MORE

Feb 13, 2019 in Python by Prateek
436 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,782 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,220 points
837 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,402 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,020 points
5,151 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
773 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,710 views
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,220 points
677 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,020 points
4,906 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
856 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,220 points
764 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
1,131 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,521 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
945 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,020 points
1,376 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,428 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,770 points
1,185 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,220 points
503 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,460 points
3,240 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
896 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,403 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
985 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,941 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,220 points
728 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 3,356 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
1,174 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,220 points
1,625 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,220 points

edited Aug 8, 2018 by Omkar 8,155 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,723 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,220 points
684 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
677 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,020 points
6,992 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
564 views
+1 vote
1 answer

Index of predicted wrong data in Keras, how to find it?

Simply, use: model.predict() pred = model.predict(x_test) indices = [i for ...READ MORE

Sep 28, 2018 in Python by Priyaj
• 58,020 points
5,865 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,685 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,967 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
1,200 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
810 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
706 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
4,003 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,752 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
1,031 views