Most answered questions in Python

0 votes
1 answer

python JSON only get keys in first level

You just need a simple .keys() >>> dct ...READ MORE

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

How to enable python3 in vim?

You didn't tell us the platform you're ...READ MORE

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

What is .pydistutils.cfg?

I don't immediately see a reason why ...READ MORE

Jan 21, 2019 in Python by SDeb
• 13,300 points
1,699 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 use read a WSDL file from the file system using Python suds?

Hi, good question. It is a very simple ...READ MORE

Jan 21, 2019 in Python by Nymeria
• 3,560 points
7,742 views
–1 vote
1 answer

How to calculate difference in timestamp columns?

First, write the data in a csv file. Then ...READ MORE

Jan 19, 2019 in Python by Omkar
• 69,230 points
627 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
957 views
0 votes
1 answer

print(instance(0).id) TypeError: 'list' object is not callable

Hey @Suraj, For me its working fine. ...READ MORE

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

Dictionary in NumPy array

You have a 0-dimensional array of object ...READ MORE

Jan 18, 2019 in Python by SDeb
• 13,300 points
8,363 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
914 views
0 votes
1 answer

What is the recommended way to randomize a list of strings using Python?

Hi. Nice question. Here is the simplified answer ...READ MORE

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

Need help checking the validity of an image file in Python

I went through the Python documentation and ...READ MORE

Jan 18, 2019 in Python by Nymeria
• 3,560 points
1,941 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,158 views
0 votes
1 answer

Shorter way to write a Python for loop

You can use the enumerate iterator: for i, ...READ MORE

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

What is the equivalent of NotImplementedError using Python?

Hi, good question! One simple answer to your ...READ MORE

Jan 17, 2019 in Python by Nymeria
• 3,560 points
2,056 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
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

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

What does [:] mean?

It's a slicing, and what it does ...READ MORE

Jan 16, 2019 in Python by SDeb
• 13,300 points
2,293 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
746 views
–1 vote
1 answer

Need help printing a Pandas Dataframe without the index in Python

Hi, the answer is a very simple ...READ MORE

Jan 16, 2019 in Python by Nymeria
• 3,560 points
2,804 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
930 views
0 votes
1 answer

Is it possible to invert a Numpy boolean array in Python using the tilde operator (~)?

Good question, glad you brought this up. I ...READ MORE

Jan 11, 2019 in Python by Nymeria
• 3,560 points
4,601 views
0 votes
1 answer

Is there any way to write native apps for Windows, Blackberry, Android and Apple devices using Python?

Hi, This is an amazing Python framework just ...READ MORE

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

How do I access a user by his/her ID using django.contrib.auth.models.User in the latest release of Django?

Hi, there is only that way and ...READ MORE

Jan 10, 2019 in Python by Nymeria
• 3,560 points
2,789 views
0 votes
1 answer

Need help extracting a schema to make use for an avro file in Python

Hi, nice question. So what I daily use ...READ MORE

Jan 10, 2019 in Python by Nymeria
• 3,560 points
4,594 views
0 votes
1 answer

Graphviz vs PyGraphViz

graphviz is lightweight library which calls graphviz ...READ MORE

Jan 9, 2019 in Python by ana1504.k
• 7,910 points
2,242 views
+1 vote
1 answer

Error loading package list:pypi.python.org

You can try doing the following : go ...READ MORE

Jan 9, 2019 in Python by ana1504.k
• 7,910 points
10,091 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,230 points
1,866 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,230 points
1,417 views
–1 vote
1 answer

Pyspark rdd How to get partition number in output ?

The glom function is what you are looking for: glom(self): ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,230 points
2,321 views
–1 vote
1 answer

Python program that calculates and prints value according to formula

Try this: import math c = 50 h = 30 value ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,230 points
4,686 views
0 votes
1 answer

difference between lists and sets

There are a lot more differences such ...READ MORE

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

Is Brython client side?

Brython itself seems to be completely client ...READ MORE

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

Path separator char in Python

There is an alternative way. you can ...READ MORE

Jan 4, 2019 in Python by SDeb
• 13,300 points
2,377 views
0 votes
1 answer

freopen() in python

sys.stdout is simply file object, so, you ...READ MORE

Jan 3, 2019 in Python by anonymous
1,242 views
0 votes
1 answer

How to check plural & singular form of a word?

You can try with the inflect 0.2.4 ...READ MORE

Jan 3, 2019 in Python by anonymous
4,031 views
0 votes
1 answer

How to check latest change time of each file using glob in python?

You can get the changing time from ...READ MORE

Jan 2, 2019 in Python by Omkar
• 69,230 points
1,178 views
0 votes
1 answer

How to traverse from a file to parse another file?

You use os.walk() module of python for ...READ MORE

Jan 2, 2019 in Python by Omkar
• 69,230 points
797 views
0 votes
1 answer

How to print a message or the error if a file is not found?

To print the message that file is not ...READ MORE

Jan 2, 2019 in Python by Omkar
• 69,230 points
2,427 views
0 votes
1 answer

Python Print lines for the closest timestamp of the event

Try this: import re import os import datetime from datetime import ...READ MORE

Jan 2, 2019 in Python by Omkar
• 69,230 points
983 views
0 votes
1 answer

Python strftime- date without leading 0?

If you add a hyphen between the ...READ MORE

Dec 31, 2018 in Python by SDeb
• 13,300 points
16,712 views
0 votes
1 answer

How to use Euler's number and power operation?

You can refer the math library of ...READ MORE

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

How can I import tensorflow libraries in my Python code?

You are doing it wrong as tf is not ...READ MORE

Dec 31, 2018 in Python by charlie_brown
• 7,720 points
5,883 views
0 votes
1 answer

MemoryError binary data storage

The problem occurs when you are using ...READ MORE

Dec 26, 2018 in Python by SDeb
• 13,300 points
659 views
0 votes
1 answer

Need help installing easy_install in Python 2.7.1 on Windows 7

That tool is part of the setuptools ...READ MORE

Dec 26, 2018 in Python by Nymeria
• 3,560 points
954 views
0 votes
1 answer

How to fit a histogram using Python?

Here is an example working on py2.6 ...READ MORE

Dec 26, 2018 in Python by Nymeria
• 3,560 points
6,078 views
+2 votes
1 answer

How can I record the X,Y limits of a displayed X,Y plot using the matplotlib show() module?

A couple hours after posting this question ...READ MORE

Dec 27, 2018 in Python by anonymous
873 views
0 votes
1 answer

Getting AttributeError: 'module' object (scipy) has no attribute 'misc' in Python. How to solve this?

>>> import scipy >>> scipy.misc Traceback (most recent call ...READ MORE

Dec 24, 2018 in Python by Nymeria
• 3,560 points
8,957 views
0 votes
1 answer

How to I clear Tkinter Canvas using Python?

To clear a canvas, use the delete method.  This ensures ...READ MORE

Dec 24, 2018 in Python by Nymeria
• 3,560 points
15,208 views