Latest questions in Python

0 votes
1 answer

Json RPC Python Client

There is json-rpc library, it supports python2.7, python3.2+, does ...READ MORE

May 30, 2019 in Python by SDeb
• 13,300 points
1,300 views
+1 vote
2 answers

Cannot install tensorflow on 32-bit Python

Unfortunately tensorflow is not supported on 32 ...READ MORE

Jan 13, 2020 in Python by jaakko
• 160 points

edited Apr 18, 2022 by Sarfaraz 11,586 views
0 votes
1 answer

How can I raise an exception in Python so that it can later be caught via an except block?

It's pretty simple to raise a query  raise ...READ MORE

May 29, 2019 in Python by Umesh
709 views
0 votes
1 answer

Python error "error: Unable to find vcvarsall.bat"

Try specifying mingw as the compiler of choice. ...READ MORE

May 29, 2019 in Python by Imran
3,173 views
0 votes
1 answer

Python error "AttributeError: incompatible shape for a non-contiguous array"

It is not always possible to change ...READ MORE

May 29, 2019 in Python by Imran
1,716 views
0 votes
1 answer

What does numpy.reshape() function do in python?

numpy.reshape() gives a new shape to an ...READ MORE

May 29, 2019 in Python by Kyraa
867 views
0 votes
1 answer

Slice an array into multiple arrays - Python

can use numpy.reshape.  In your case, pass 1 ...READ MORE

May 29, 2019 in Python by Alia
618 views
0 votes
1 answer

zeropad all the arrays to match the largest array in that file in python

You can try something like this: import numpy ...READ MORE

May 29, 2019 in Python by Wazeer
363 views
0 votes
0 answers

How can we use sqlite with WAL?

Can you give an example? READ MORE

May 29, 2019 in Python by Waseem
• 4,540 points

edited May 30, 2019 by Omkar 428 views
0 votes
0 answers

How can you subtract a day from date?

Can you give an example? READ MORE

May 29, 2019 in Python by Waseem
• 4,540 points

edited May 30, 2019 by Omkar 261 views
0 votes
1 answer

How do I trim extra zeros from a 2D array in python?

Hey @Laksha, you can try something like ...READ MORE

May 29, 2019 in Python by Yamini
2,501 views
0 votes
1 answer

How do I trim the leading or trailing zeros from a 1d array in python?

Hey @Akki, you can use the numpy ...READ MORE

May 29, 2019 in Python by Wakir
1,449 views
0 votes
1 answer

Has Python 3.0 reached end of support?

The first release of Python 3 was ...READ MORE

Jun 7, 2019 in Python by Harsh
• 180 points
396 views
0 votes
1 answer

What is the most recent version of python 3?

Python 3.7.3 is the latest release of ...READ MORE

Jun 7, 2019 in Python by Harsh
• 180 points
480 views
0 votes
1 answer

Deploying Flask on Windows in production

Installing on Windows is kind of like ...READ MORE

May 29, 2019 in Python by SDeb
• 13,300 points
3,237 views
0 votes
1 answer

Hive client for Python 3.x

If you have HiveServer2 installed you can ...READ MORE

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

Error saying "ValueError: Invalid file object: <_io.BufferedReader name=9>"

Once you've executed the following command, your ...READ MORE

May 28, 2019 in Python by Tamanna
4,984 views
0 votes
1 answer

Error saying "TypeError: descriptor object needs an argument"

The error is pretty straight forward, toy ...READ MORE

May 28, 2019 in Python by Alisha
12,805 views
0 votes
1 answer

How do I install SortedContainers in python?

You can install SortedContainers using pip: > pip ...READ MORE

May 28, 2019 in Python by Jinu
4,250 views
0 votes
1 answer

What are sorted container in python?

Sorted Containers is an Apache2 licensed sorted ...READ MORE

May 28, 2019 in Python by Alok
395 views
0 votes
1 answer

print the random list's item index number in python

Hey @Alia, you can use a python ...READ MORE

May 28, 2019 in Python by Patrick
637 views
0 votes
1 answer

Select more than one item randomly from the list

You can use random.sample() function in the ...READ MORE

May 28, 2019 in Python by Yesha
667 views
0 votes
1 answer

Does making two consecutive calls of random.choice(foo) return two different results

Each choice is random, so it can ...READ MORE

May 28, 2019 in Python by Akaya
539 views
0 votes
2 answers

Pick a random item from the list - Python

You can also use secrets.choice() import secrets list = ...READ MORE

May 28, 2019 in Python by Kim
1,043 views
–1 vote
1 answer

Playing with Lists in Python

Hey @Fez, you can try something like ...READ MORE

May 28, 2019 in Python by Thanisha
998 views
0 votes
0 answers

Explicit type conversion not happening

I have the following python code: playerlocation =(input("Player ...READ MORE

May 28, 2019 in Python by Gayatri
283 views
0 votes
1 answer

Python code Tic Tac Toe game

You could use random.shuffle from random import shuffle players ...READ MORE

May 28, 2019 in Python by Idam
1,731 views
0 votes
1 answer

How to put time delay in Python?

You can use sleep() method to sleep ...READ MORE

May 28, 2019 in Python by Taj
• 1,080 points
463 views
0 votes
1 answer

Closest value and its index in a sorted list - Python

You can try this @Mahesh: lst = [ ...READ MORE

May 28, 2019 in Python by Sai
9,272 views
0 votes
1 answer

Difference between %s and %d in python string formatting??

%s and %d are used for string ...READ MORE

May 28, 2019 in Python by Shabnam
• 930 points
2,953 views
0 votes
1 answer

What are the features of Python 3?

Python 3 offers rich functionality making it ...READ MORE

May 28, 2019 in Python by Harsh
• 260 points
891 views
0 votes
2 answers

Which programming language should I learn - Python or PHP?

It really depends on what you want ...READ MORE

Jun 11, 2019 in Python by Morten

reshown Jun 11, 2019 by Vardhan 601 views
0 votes
1 answer

py2exe windows service problem

Check that your setup.py file should contain: setup(service=["we ...READ MORE

May 28, 2019 in Python by SDeb
• 13,300 points
953 views
0 votes
1 answer

How can I deal with python eggs for multiple platforms in one location?

Try virtualenv : http://pypi.python.org/pypi/virtualenv This helps you create isolated ...READ MORE

May 28, 2019 in Python by SDeb
• 13,300 points
693 views
0 votes
1 answer

What to do when len() does not return the number of integers in range(1,100)?

You can use the following code block: x=range(1,100) len(x) Output: ...READ MORE

May 28, 2019 in Python by Fata
• 1,050 points
571 views
0 votes
1 answer

What to do when I get and error saying python not recognized as internal or external command?

You need to set up the path ...READ MORE

May 28, 2019 in Python by Fata
• 1,050 points
2,232 views
0 votes
1 answer

How do I check if a list is empty in python?

Hey @Vedant, that's pretty simple and straightforward: if ...READ MORE

May 28, 2019 in Python by Karthik
818 views
0 votes
1 answer

How to drop missing value in python data-frame?

Hi Sarada,  I understand you are having problems with ...READ MORE

May 28, 2019 in Python by sampriti
• 1,120 points
1,155 views
0 votes
1 answer

Is there a way to loop between 0 and 1 by 0.1 in python?

You can use the linespace function. It ...READ MORE

May 28, 2019 in Python by Olly
2,658 views
0 votes
1 answer

Error saying "TypeError: range() integer end argument expected"

Try this: [x * 0.01 for x in ...READ MORE

May 27, 2019 in Python by Keshav
1,057 views
0 votes
1 answer

What does the random.triangular(low, high, mode) function do in python?

It returns a random floating point number ...READ MORE

May 27, 2019 in Python by Vinod
926 views
0 votes
1 answer

How do I get a random number with a float range in python?

Use random.uniform(a, b): Returns a random floating point ...READ MORE

May 27, 2019 in Python by Kiran
709 views
0 votes
1 answer

How do I compute the cross spectral density of two signals?

Hey @Akash, if your just looking for ...READ MORE

May 27, 2019 in Python by Kavya
893 views
0 votes
1 answer

An example showing how to plot the coherence of two signals

This should work well: import numpy as np import ...READ MORE

May 27, 2019 in Python by anonymous

edited May 27, 2019 by Kalgi 1,698 views
0 votes
1 answer

How to use categorical variables in Matplotlib?

Many times you want to create a ...READ MORE

May 27, 2019 in Python by Lisha
1,314 views
0 votes
1 answer

Example code for creating broken barh graph using matplotlib

Try this, it should work well. import matplotlib.pyplot ...READ MORE

May 27, 2019 in Python by Himanshu
1,933 views
0 votes
1 answer

Example of creating horizontal bar chart using matplotlib

Try this: import matplotlib.pyplot as plt import numpy as ...READ MORE

May 27, 2019 in Python by Vaishnavi
1,640 views
0 votes
1 answer

Example showing a way to create a grouped bar chart with Matplotlib?

Have a look at this: import matplotlib import matplotlib.pyplot ...READ MORE

May 27, 2019 in Python by Bobin
2,820 views
0 votes
1 answer

example of creating a stacked bar plot with error bars using the bar function

Have a look at this: import numpy as ...READ MORE

May 27, 2019 in Python by Kunal
1,231 views
0 votes
1 answer

Python error "TypeError: range() integer end argument expected, got numpy.float64."

Hi @Kashish, try something like this: for i ...READ MORE

May 27, 2019 in Python by Harish
2,661 views