Most viewed questions in Python

0 votes
0 answers

Error: 'int' object is not subscriptable - Python

I was experimenting with a straightforward piece ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
766 views
0 votes
1 answer

I installed windows 10 through vmware workstation . I want to connect remote machine using python winrm im getting error

Hey, @Natraj, This basically means that no response ...READ MORE

Dec 2, 2020 in Python by Gitika
• 65,910 points
766 views
0 votes
0 answers

"getaddrinfo failed", what does that mean?

I am getting this error when launching ...READ MORE

May 13, 2022 in Python by Kichu
• 19,050 points
765 views
0 votes
1 answer

How do you split a list into evenly sized chunks?

Here's a generator that yields the chunks ...READ MORE

Dec 3, 2020 in Python by Gitika
• 65,910 points
765 views
0 votes
1 answer

What is the fucntion of mkdir -p in Python

mkdir -p gives you an error if the ...READ MORE

Oct 30, 2018 in Python by Priyaj
• 58,090 points
765 views
0 votes
1 answer

How to get list from pandas DataFrame column headers?

You can get the values as a ...READ MORE

Dec 23, 2020 in Python by Gitika
• 65,910 points
764 views
0 votes
1 answer

What are higher-order functions?

Higher-order functions are those functions that either ...READ MORE

Jul 25, 2019 in Python by Fata
• 1,050 points
764 views
+2 votes
1 answer

How do you make a block comment in python?

''' This is a multiline comment. I ...READ MORE

Aug 23, 2018 in Python by Priyaj
• 58,090 points
764 views
+2 votes
2 answers

How to use BeatifulSoup for webscraping?

your programme is fine until you start ...READ MORE

Apr 4, 2018 in Python by charlie_brown
• 7,720 points
763 views
0 votes
1 answer

How to test python code using Pytest?

Hi@akhtar, You can use the Pytest module to ...READ MORE

Jun 24, 2020 in Python by MD
• 95,440 points
762 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
762 views
0 votes
1 answer

How to set dataframe based on Index Name & Column name ?

Hi@Gaurav, You can use set_index function in pandas. It allows ...READ MORE

Jun 29, 2020 in Python by MD
• 95,440 points
761 views
0 votes
1 answer

How to fetch HTML code using urllib module in Python?

Hi@akhtar, You can use urllib module to fetch ...READ MORE

Jun 26, 2020 in Python by MD
• 95,440 points
761 views
0 votes
1 answer

How to create new environment using conda?

Hi@akhtar, Environment means you are creating your own ...READ MORE

Apr 21, 2020 in Python by MD
• 95,440 points
761 views
+2 votes
1 answer

How to check the state of a user given instance id using filters

Seems like the "ec2_con_re.instances" you are using ...READ MORE

Aug 1, 2019 in Python by Aishwarya
761 views
0 votes
3 answers

What is python? Where it is used?

 Python is develop by Guido Van Rossum ...READ MORE

Mar 18, 2019 in Python by rajesh kumar
761 views
0 votes
1 answer

How do I copy a file in python?

Use the shutil module. copyfile(src, dst) Copy the contents ...READ MORE

Jul 31, 2018 in Python by Priyaj
• 58,090 points
757 views
0 votes
1 answer

What is the Python equivalent for a case/switch statement?

if x == 'a':  # Do the ...READ MORE

Jul 26, 2018 in Python by Priyaj
• 58,090 points
757 views
0 votes
1 answer

Is it possible to run a function in Python using the command line?

Suppose your file name is demo.py and ...READ MORE

Jun 26, 2019 in Python by Neel
• 3,020 points
756 views
0 votes
0 answers

How to read lines from compressed text files in Python

Is it easy to read a line ...READ MORE

Dec 27, 2018 in Python by Anirudh
• 2,080 points
756 views
0 votes
1 answer

Example to illustrate the use of the print_changes_only global parameter in Python

Hi @Vish, First of all, the parameter ...READ MORE

Jun 3, 2019 in Python by Mohit
754 views
0 votes
2 answers

why do we use operator.abs

 python and abs() in Python The abs() take ...READ MORE

Apr 3, 2019 in Python by anonymous
753 views
0 votes
1 answer

How to implement Linked List in Python?

You can use Deque that works better than linked list ...READ MORE

Oct 26, 2018 in Python by Priyaj
• 58,090 points
753 views
0 votes
1 answer

Installing specific package versions with pip

TL;DR: pip install -Iv (i.e. pip install -Iv MySQL_python==1.2.2) First, I ...READ MORE

Nov 22, 2020 in Python by Gitika
• 65,910 points
752 views
0 votes
0 answers

Help: Receive data from tkinter gui and perform mathematical operations between lists

hello friends, I have been working on a ...READ MORE

Nov 4, 2020 in Python by Jessica
• 120 points
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
752 views
0 votes
1 answer

Python string formatting: % vs. .format

To answer your first question... .format just ...READ MORE

Aug 17, 2018 in Python by Priyaj
• 58,090 points
752 views
0 votes
0 answers

Object Oriented Python for area of triangle

Write a Python Program(with class concepts) to ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
751 views
0 votes
1 answer

Writing unit tests in Python: How do I start?

If you're brand new to using unittests, ...READ MORE

Sep 18, 2018 in Python by Priyaj
• 58,090 points
750 views
0 votes
1 answer

How to create transaction in GnuCash in response to an email?

Here's a template, along with a couple ...READ MORE

Sep 5, 2018 in Python by Priyaj
• 58,090 points
748 views
0 votes
1 answer

Append & Extend

Hi. This question has already been answered. Take ...READ MORE

Jul 2, 2018 in Python by Nietzsche's daemon
• 4,260 points
748 views
0 votes
1 answer

Failed building wheel for wordcloud #105

If you are running Python 3.5 you ...READ MORE

Sep 14, 2020 in Python by Gitika
• 65,910 points
747 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
747 views
0 votes
1 answer

How to merge two DataFrame in Pandas?

Hi@akhtar, You can use Pandas.merge() function to merge ...READ MORE

Jun 23, 2020 in Python by MD
• 95,440 points
746 views
0 votes
0 answers

nifi dataframe.py

Mar 13, 2020 in Python by pavankumar
• 140 points
746 views
0 votes
1 answer

Relative imports in Python 3

Because the first statement, from.mymodule import myfunction, ...READ MORE

Feb 16, 2023 in Python by Rishu
• 300 points
745 views
0 votes
0 answers
0 votes
1 answer

What is the key difference between self in ruby and self in python?

Ruby and Python are actually very different languages (although ...READ MORE

Jul 30, 2019 in Python by Mohammad
• 3,230 points
744 views
0 votes
0 answers
0 votes
1 answer

Python 3 equivalent of SimpleHTTPServer

The SimpleHTTPServer module has been merged into ...READ MORE

Nov 21, 2018 in Python by SDeb
• 13,300 points
744 views
+1 vote
1 answer

What does [::-1] do?

[::-1] does not reverse the order of ...READ MORE

Jun 6, 2019 in Python by Nisa
• 1,090 points
742 views
0 votes
0 answers

TypeError: not all arguments converted during string formatting python

The program is supposed to take in ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
741 views
0 votes
1 answer

Is there a Python equivalent to `perl -pi -e`?

The command line usage from 'python -h' ...READ MORE

Feb 15, 2019 in Python by SDeb
• 13,300 points
741 views
0 votes
1 answer

How do you express binary literals in Python?

For reference—future Python possibilities: Starting with Python 2.6 you ...READ MORE

Aug 14, 2018 in Python by aryya
• 7,450 points
741 views
0 votes
1 answer

List changes unexpectedly after assignment. How do I clone or copy it to prevent this?

With new_list = my_list, you don't actually have ...READ MORE

Dec 7, 2020 in Python by Gitika
• 65,910 points
740 views
0 votes
2 answers

Which IDE should I use for python?

Pycharm or Spyder. You can even use visual ...READ MORE

Jun 23, 2020 in Python by Anjali
740 views
+1 vote
0 answers

ssh db connection using python2.7

I am supposed to use python 2.7 ...READ MORE

Nov 22, 2019 in Python by sweta
• 130 points
738 views
0 votes
1 answer

Is there an equivalent of C’s (?:) ternary operator in python?

Yes, there is. The syntax is as ...READ MORE

Jul 25, 2019 in Python by Alia
738 views
0 votes
1 answer

.pyc files in python

.pyc files contain the bytecode which are ...READ MORE

Jun 22, 2018 in Python by Hamartia's Mask
• 1,580 points
738 views