Trending questions in Python

0 votes
1 answer

opencv Unable to stop the stream: Inappropriate ioctl for device

I have solved this issue on Ubuntu ...READ MORE

Jul 20, 2019 in Python by SDeb
• 13,300 points
2,969 views
0 votes
1 answer

Bypassing Cloudflare Scrapeshield

Scrapeshield basically checks if you are using ...READ MORE

Jun 24, 2019 in Python by SDeb
• 13,300 points
4,058 views
0 votes
1 answer

How to add a new Python interpreter in PyCharm?

Refer to the below screenshots: Then set a ...READ MORE

May 30, 2019 in Python by Shabnam
• 930 points
5,121 views
+1 vote
1 answer

How to handle Real-Time Matplotlib Plotting

To draw a continuous set of random ...READ MORE

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

Python Error "ERROR: PyQt4-4.11.4-cp27-cp27m-win32.whl is not a supported wheel on this platform."

cp27 means it's for python 2.7. Make ...READ MORE

Jul 22, 2019 in Python by Greg
2,801 views
+1 vote
2 answers

Remove all whitespace in a string in Python

You can also use regular expressions for ...READ MORE

Aug 31, 2018 in Python by Omkar
• 69,210 points
16,818 views
+2 votes
0 answers

I am trying to create mininet, but I cannot ping all host and switch

I am trying to do mininet environment ...READ MORE

Aug 4, 2019 in Python by Jiun-Jung
• 140 points
2,156 views
0 votes
1 answer

Get all tags from taggit

You can use all() to get all the tags ...READ MORE

Aug 5, 2019 in Python by SDeb
• 13,300 points
2,164 views
0 votes
1 answer

Python argparse error "NameError: name 'file' is not defined"

The right datatype for destination in argpasrse module ...READ MORE

Nov 28, 2018 in Python by Omkar
• 69,210 points
12,937 views
0 votes
2 answers

Equivalent of a?b:c in Python

result = "F" if(isfemale_bit) else "M" print(result) Try this ...READ MORE

Dec 15, 2019 in Python by Manel
3,783 views
0 votes
1 answer

Connect to an URI in postgres

The connection string passed to psycopg2.connect is ...READ MORE

Jul 29, 2019 in Python by SDeb
• 13,300 points
2,410 views
0 votes
1 answer

i had problem with selenium x path i make Facebook sharing script but he is not clicking share button? i'm using python

Hey Hazma, I tried running your code, ...READ MORE

Jul 26, 2019 in Python by Abha
• 28,140 points
2,531 views
0 votes
0 answers

why iam getting this error

Sep 9, 2019 in Python by NEELAPALA
• 120 points

reopened Sep 9, 2019 by Omkar 595 views
0 votes
1 answer

Python error "_tkinter.TclError: unknown font style "Normal""

Change the line  pen.write("score: {} High Score: {}".format(score, ...READ MORE

Jul 22, 2019 in Python by Yashita
2,621 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,982 views
+1 vote
1 answer

how to run list of functions using Thread?

You could import the file with function ...READ MORE

Aug 26, 2019 in Python by Vishaka
1,104 views
0 votes
1 answer

How to iterate over row in a Dataframe in Pandas?

Hi, You can use df.iterrows(), it yields both ...READ MORE

Jul 19, 2019 in Python by Taj
• 1,080 points
2,702 views
0 votes
0 answers

What is operator overloading in python?

Can you give an example? READ MORE

Sep 10, 2019 in Python by Waseem
• 4,540 points
452 views
0 votes
2 answers

In Python, how do I read a file line-by-line into a list?

readline function help to  read line in ...READ MORE

Jun 21, 2020 in Python by sahil
• 580 points
1,434 views
0 votes
1 answer

MiniNAM error "ovs-vsctl: no bridge named s1, ovs-vsctl: no bridge named s2"

You are getting this error because you ...READ MORE

Aug 5, 2019 in Python by Haider
1,917 views
0 votes
1 answer

Splitting a column with multiple values in python

Try using the following: df['id'] = df.index+1 df.set_index('id').col_name.str.split(',', expand ...READ MORE

Jul 9, 2019 in Python by SDeb
• 13,300 points
3,059 views
0 votes
0 answers

What is the difference between == and is operator in python?

What is the basic use of is ...READ MORE

Sep 10, 2019 in Python by Waseem
• 4,540 points
400 views
0 votes
1 answer

KDE in seaborn distplot()

Kernel Density Estimation (KDE) is a way ...READ MORE

Jul 16, 2019 in Python by Kunal
2,717 views
0 votes
1 answer

Extracting time from a timedelta

Use the following piece of code: import datetime a ...READ MORE

Aug 13, 2019 in Python by Wajiha
• 1,950 points
1,494 views
0 votes
1 answer

Adding two pandas dataframes

you can try the following: x.add(y, fill_value=0) import pandas ...READ MORE

Feb 12, 2019 in Python by SDeb
• 13,300 points
9,333 views
0 votes
1 answer

How to convert Python Datetime to String without microsecond component?

If you want to format a datetime object in ...READ MORE

Aug 2, 2019 in Python by Shabnam
• 930 points
1,936 views
0 votes
1 answer

Python error "raise CommandFailedError(args) bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)"

Install pyopenssl to your python pip install pyopenssl ...READ MORE

Aug 5, 2019 in Python by Kalgi
• 52,360 points
1,763 views
0 votes
1 answer

Polynomials in Python

You can easily find polynomials of any ...READ MORE

Aug 27, 2019 in Python by Wajiha
• 1,950 points
811 views
0 votes
1 answer

Pandas print the first few rows of dataframe

Pandas allows you to slice the dataframe ...READ MORE

May 9, 2019 in Python by Shri
5,540 views
0 votes
1 answer

How to create a function like f(y) = xy^2 in Python?

This is very easy. have a look ...READ MORE

Aug 5, 2019 in Python by Neel
• 3,020 points

edited Aug 6, 2019 by Kalgi 1,724 views
0 votes
0 answers

How do you run a python script online?

Is there a platform where you can ...READ MORE

Sep 4, 2019 in Python by Waseem
• 4,540 points
455 views
0 votes
1 answer

Meaning of 10j in SciPy

10j in b = np.r_[3,[0]*5,-1:1:10j] means that the ...READ MORE

Aug 27, 2019 in Python by Wajiha
• 1,950 points
754 views
0 votes
0 answers

What is dictionary comprehension in python?

Is it possible to do dictionary comprehension ...READ MORE

Sep 6, 2019 in Python by Waseem
• 4,540 points
389 views
0 votes
1 answer

Why does changing one list, change another - Python

Hey @Aleesha, here when you write x=y, ...READ MORE

Jul 25, 2019 in Python by Kanika
2,177 views
0 votes
1 answer

How do you select a python interpreter in Pycharm?

Follow the following steps: Open the settings Open Project ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
2,268 views
0 votes
1 answer

SSH into an ec2 instance using boto

Hi @Neha, try something like thus: import boto3 import ...READ MORE

Jun 24, 2019 in Python by Varsha
3,448 views
0 votes
0 answers

What does super() do in python?

How does it help in multiple inheritance? READ MORE

Sep 6, 2019 in Python by Waseem
• 4,540 points
321 views
0 votes
0 answers

How is type conversion done in python?

How do you convert a list to ...READ MORE

Sep 3, 2019 in Python by Waseem
• 4,540 points
406 views
0 votes
1 answer

Is it possible to read a text file into a string variable and then scrap the newlines?

This can be done easily in Python. ...READ MORE

Aug 7, 2019 in Python by Arvind
• 3,040 points
1,538 views
0 votes
2 answers

Avoiding multiple nested for-loops in python

Instead of multi-loop, If you can categorize ...READ MORE

Sep 15, 2018 in Python by pedro67657
• 160 points

edited Sep 15, 2018 by Vardhan 15,603 views
+1 vote
1 answer

I want to understand the difference between delete, remove and pop, in Python.

Hi, Lets look at all the methods one ...READ MORE

Jun 7, 2019 in Python by Taj
• 1,080 points
4,119 views
0 votes
1 answer

convert a SAS datetime in Pandas

SAS date value is a value that ...READ MORE

Jul 8, 2019 in Python by SDeb
• 13,300 points
2,825 views
–1 vote
0 answers

Python Challenge : Writing a file

Write a sign up program for a ...READ MORE

Sep 4, 2019 in Python by Waseem
• 4,540 points
395 views
0 votes
1 answer

Can you explain what is the use _init_ and self in python?

Hi, The basic difference between these two are _init_ ...READ MORE

Aug 14, 2019 in Python by anonymous
1,213 views
0 votes
1 answer

Move turtle using the arrow keys in Python

You can use something like this: wn.onkey(move_up, 'Up') wn.onkey(move_left, ...READ MORE

Jul 6, 2019 in Python by Travis
2,937 views
0 votes
0 answers

what is the use of modules in python ?

Sep 5, 2019 in Python by anonymous
292 views
0 votes
0 answers

What is python image library?

How to install python image library? READ MORE

Sep 3, 2019 in Python by Waseem
• 4,540 points
377 views
0 votes
1 answer

How to measure time elapsed in Python?

If you just want to measure the ...READ MORE

Dec 4, 2018 in Python by SDeb
• 13,300 points
12,125 views
0 votes
1 answer

How to count the number of elements in a list?

To count the number of elements of ...READ MORE

May 27, 2019 in Python by Nisa
• 1,090 points
4,594 views
0 votes
1 answer

Package installed but still says "ImportError: No module named pygame.locals"

So Harsha, you Import the module first ...READ MORE

Jun 18, 2019 in Python by Varsha
3,580 views