Trending questions in Python

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,996 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
913 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,361 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
3,025 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,341 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
796 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,878 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,693 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
7,096 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,384 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
988 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,994 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
744 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
663 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,209 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
898 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,220 points
1,810 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
1,128 views
0 votes
2 answers

Help me solve the code

The fetchone() method fetches the result of ...READ MORE

Jan 9, 2019 in Python by Omkar
• 69,220 points
1,253 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
1,165 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,922 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
3,039 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,698 views
0 votes
1 answer

Python equivalent for static variables within a function?

You can use the following code, that ...READ MORE

Oct 17, 2018 in Python by Priyaj
• 58,020 points
5,066 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,112 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,220 points
1,013 views
0 votes
1 answer

Understanding repr( ) function in Python

>>> x = 'foo' >>> x 'foo' So the name x is ...READ MORE

Sep 17, 2018 in Python by Priyaj
• 58,020 points
6,279 views
0 votes
2 answers

Error: Speech to Text Codec cannot decode the bytes in position

import speech_recognition as sr r = sr.Recognizer() audio ='C\Users\Desktop\audiofile1.wav' with ...READ MORE

Nov 28, 2018 in Python by Nabarupa Das
3,137 views
0 votes
2 answers

How do I connect to a MySQL Database in Python?

connect mysql database with python import MySQLdb db = ...READ MORE

Mar 28, 2019 in Python by rajesh
• 1,270 points
2,042 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,932 views
0 votes
0 answers

Is there any module in Python that I can use for Wiki markup?

Hi all, simple question. Is there any ...READ MORE

Jan 22, 2019 in Python by Anirudh
• 2,090 points
772 views
0 votes
1 answer

How can I use indices in math using python

Operator ^ is a bitwise operator, which does "bitwise exclusive or". More: http://wiki.python.org/moin/BitwiseOperators The ...READ MORE

Dec 11, 2018 in Python by aryya
• 7,460 points
2,515 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,642 views
0 votes
1 answer

Why there is no do while loop in python

There is no do...while loop because there ...READ MORE

Aug 6, 2018 in Python by Priyaj
• 58,020 points
7,920 views
0 votes
1 answer

Size of an open file object

You can use the following and try ...READ MORE

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

Make a unix alias with python script

The scope of an alias command is the shell ...READ MORE

Sep 20, 2018 in Python by Priyaj
• 58,020 points
5,922 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
1,023 views
0 votes
1 answer

How can I define a multidimensional array in python using ctype?

Here's one quick-and-dirty method: >>> A = ((ctypes.c_float ...READ MORE

Oct 9, 2018 in Python by aryya
• 7,460 points
5,063 views
0 votes
1 answer

How to install OpenCV for python3 in Ubuntu?

I found this: https://pypi.python.org/pypi/opencv-python OpenCV on wheels 'Unofficial OpenCV packages ...READ MORE

Nov 28, 2018 in Python by Nymeria
• 3,560 points
2,905 views
0 votes
1 answer

How do you get the logical xor of two variables in Python?

If you're already normalizing the inputs to ...READ MORE

May 29, 2018 in Python by aryya
• 7,460 points
10,768 views
0 votes
1 answer

ProgrammingError: not all arguments converted during string formatting

Sorted!!!! just found the solution, 1 - apparently ...READ MORE

Sep 20, 2018 in Python by Priyaj
• 58,020 points
5,839 views
0 votes
0 answers

How to implement multiple try codes in a single block using Python?

Hi all, As per the title, I am ...READ MORE

Jan 14, 2019 in Python by Anirudh
• 2,090 points
834 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,220 points
1,241 views
0 votes
1 answer

Django form validation: making “required” conditional?

This is done with the clean method on the ...READ MORE

Aug 30, 2018 in Python by Priyaj
• 58,020 points
6,640 views
0 votes
1 answer

How to sort Counter by value using python?

Use the Counter.most_common() method, it'll sort the items for you: >>> ...READ MORE

May 23, 2018 in Python by charlie_brown
• 7,720 points
10,900 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,220 points
1,148 views
0 votes
1 answer

How to download intext images with beautiful soup

Ohh... I got what you need. Try this: html_data ...READ MORE

Sep 20, 2018 in Python by Priyaj
• 58,020 points
5,640 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
909 views
+3 votes
2 answers

Compiled vs Interpreted Languages

Compiled languages are written in a code ...READ MORE

Dec 3, 2018 in Python by allenvarna
• 540 points
5,959 views
0 votes
1 answer

How to break for loop in an if statement

You can break out of each loop ...READ MORE

Nov 16, 2018 in Python by Jino
• 5,820 points
3,125 views