Trending questions in Python

0 votes
0 answers

Excel attachments inside another Excel file handling?

Thank you in advance. I would like open ...READ MORE

Mar 23, 2019 in Python by M
• 160 points
443 views
0 votes
0 answers

what is a name error in python?

why am i getting a name error ...READ MORE

Mar 8, 2019 in Python by anonymous
1,088 views
0 votes
1 answer

How to get base class type in Python?

Yes, There is an alternative. You can ...READ MORE

Feb 8, 2019 in Python by SDeb
• 13,300 points
2,196 views
0 votes
1 answer

Transpose list of lists

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

Mar 2, 2019 in Python by SDeb
• 13,300 points
1,275 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
3,440 views
0 votes
2 answers

argparse argument order

Using Pisa will serve your needs.. READ MORE

Feb 28, 2019 in Python by Pratosh kumar
1,350 views
+2 votes
1 answer

How to install pip in windows?

Step 1:  Open the following link and go to ...READ MORE

Nov 27, 2018 in Python by Priyaj
• 58,020 points
5,243 views
0 votes
1 answer

Why am I getting a error when I am printing two different data types in python?

different data type is being used. that ...READ MORE

Mar 6, 2019 in Python by Mohammad
• 3,230 points
1,042 views
0 votes
1 answer

Python sort() function arguments

Both sort and sorted have three keyword arguments: cmp, key and reverse. L.sort(cmp=None, key=None, reverse=False) -- ...READ MORE

Oct 8, 2018 in Python by SDeb
• 13,300 points
8,038 views
0 votes
1 answer

How do I sort a dictionary by value?

If you construct a dictionary with the ...READ MORE

Mar 13, 2019 in Python by Trisha
752 views
0 votes
1 answer

How to install python

@Akanksha if you are new to python, ...READ MORE

Feb 28, 2019 in Python by Anvi
• 14,150 points
1,268 views
0 votes
1 answer

How to merge two dictionaries in a single expression?

In Python 3.5 or greater: z = {**x, ...READ MORE

Mar 13, 2019 in Python by Trisha
696 views
0 votes
1 answer

Pygtk color for drag_highlight

To make the line around the EventBox, ...READ MORE

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

How do I check which files are open or closed in Python?

Hi, good question. I have a solution ...READ MORE

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

how do i check for exceptions in python?

use self.assertRaises method as a context manager. def ...READ MORE

Mar 12, 2019 in Python by Mohammad
• 3,230 points
696 views
0 votes
1 answer

Add one row to pandas DataFrame

You can try the following : >>> import ...READ MORE

Mar 2, 2019 in Python by SDeb
• 13,300 points
1,132 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,020 points
2,951 views
0 votes
1 answer

Install Python on Ubuntu

@Abha you are right about pre-installation of python, ...READ MORE

Mar 1, 2019 in Python by Pratibha
• 3,690 points
1,143 views
0 votes
1 answer

Accessing the index in 'for' loops?

Use enumerate to get the index with ...READ MORE

Mar 13, 2019 in Python by Trisha
639 views
0 votes
0 answers

inv_ypred mean in python

Mar 7, 2019 in Python by anonymous

recategorized Mar 7, 2019 by Vardhan 906 views
0 votes
1 answer

datetime.datetime.now() + 1

You can write the code as follows ...READ MORE

Mar 11, 2019 in Python by SDeb
• 13,300 points
686 views
0 votes
1 answer

What is the purpose of Zope Interfaces?

You can actually test if your object ...READ MORE

Feb 28, 2019 in Python by SDeb
• 13,300 points
1,166 views
0 votes
0 answers

Beautiful soap Python

Need to ignore <a> with <img> tag ...READ MORE

Mar 14, 2019 in Python by Suresh
• 120 points
602 views
0 votes
1 answer

Circular buffer in Python

You can use collections.deque with a maxlen ...READ MORE

Feb 7, 2019 in Python by SDeb
• 13,300 points
2,030 views
0 votes
1 answer

How to write to CSV line by line in python

The simple way of doing this will ...READ MORE

Nov 15, 2018 in Python by findingbugs
• 3,260 points
5,655 views
+1 vote
1 answer

Python function to run hdfs commands

proc = subprocess.Popen(args_list, stdout=subprocess.PIPE, stderr=s ...READ MORE

Dec 7, 2018 in Python by Omkar
• 69,220 points
4,685 views
0 votes
1 answer

Python script for how much total salary cost has increased

Here you can use groupby() and mean() to get the desired ...READ MORE

Feb 14, 2019 in Python by Umar
1,719 views
0 votes
1 answer

How do I do monkeypatching in python?

A print statement does its IO through ...READ MORE

Mar 5, 2019 in Python by SDeb
• 13,300 points
860 views
0 votes
1 answer

How to find cos(60) in radin measure after importing math function

Hi Kushal!  If you have the value of ...READ MORE

Feb 22, 2019 in Python by Omkar
• 69,220 points
1,330 views
0 votes
1 answer

How to properly print timezone information using python?

Part of the problem here is that ...READ MORE

Feb 14, 2019 in Python by aryya
• 7,460 points
1,661 views
0 votes
1 answer

Get object by id()

You'll probably want to consider implementing it ...READ MORE

Feb 20, 2019 in Python by SDeb
• 13,300 points
1,406 views
0 votes
0 answers

how to print all the roles used by windows instances.

Mar 12, 2019 in Python by Smith
585 views
0 votes
1 answer

How to access list in Python?

A list is created by adding comma ...READ MORE

Mar 4, 2019 in Python by Priyaj
• 58,020 points
851 views
0 votes
1 answer

Open-Source Forum with API

phpBB would be the first that comes ...READ MORE

Mar 5, 2019 in Python by SDeb
• 13,300 points
794 views
0 votes
1 answer

When is the perfect time to use Tornado in python?

There is a server and a webframework. ...READ MORE

Feb 14, 2019 in Python by aryya
• 7,460 points
1,607 views
0 votes
1 answer

How to find if setuptools is installed in python?

You can use python interpreter to check ...READ MORE

Jan 29, 2019 in Python by Omkar
• 69,220 points
2,247 views
0 votes
0 answers

cannot read a csv file in python

i am getting an error reading a ...READ MORE

Mar 6, 2019 in Python by Mohammad
• 3,230 points
746 views
0 votes
1 answer

Python command line 'file input stream'

You can use argparse to create an ...READ MORE

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

How to use for loop in Python?

There are multiple ways of using for ...READ MORE

Mar 4, 2019 in Python by Priyaj
• 58,020 points
747 views
0 votes
1 answer

Regarding pyc file in Python

When you run a Python script, Python ...READ MORE

Feb 7, 2019 in Python by Yogi
1,811 views
0 votes
1 answer

What is a dictionary in Python?

Dictionary can be understood as a key-value ...READ MORE

Mar 4, 2019 in Python by Priyaj
• 58,020 points
689 views
0 votes
1 answer

Print Delimited list

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

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

How to zip with a list output in Python instead of a tuple output?

Good question - Considering that you are ...READ MORE

Feb 7, 2019 in Python by Nymeria
• 3,560 points
1,769 views
0 votes
1 answer

Add string in a certain position

Python Strings are immutable. >>> s='355879ACB6' >>> s[4:4] = ...READ MORE

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

Which is better if we compare C vs Python?

It depends on what do you expect ...READ MORE

Mar 6, 2019 in Python by SDeb
• 13,300 points
560 views
0 votes
3 answers

What is the python keyword “with” used for?

The with statement in Python simplifies exception ...READ MORE

Jul 19, 2019 in Python by rahul
• 360 points
1,651 views
0 votes
1 answer

Does Python's time.time() return the local or UTC timestamp?

The time.time() function returns the number of seconds since ...READ MORE

Nov 14, 2018 in Python by charlie_brown
• 7,720 points
5,368 views
0 votes
1 answer

How to use multiprocessing queue in Python?

This is a simple example of a ...READ MORE

Oct 25, 2018 in Python by SDeb
• 13,300 points
6,227 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,613 views