Most viewed questions in Python

0 votes
1 answer

Python join: why is it string.join(list) instead of list.join(string)?

This is because join is a "string" ...READ MORE

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

What are raw string literals?

A raw string literal opens with a sequence of ...READ MORE

Jul 31, 2019 in Python by Mohammad
• 3,230 points
645 views
0 votes
1 answer

Compiling Python

You can use the following: python yourfile.py You have ...READ MORE

Apr 16, 2019 in Python by SDeb
• 13,300 points
645 views
0 votes
1 answer

How to create a zip archive of a directory in Python?

Hii, The easiest way is to use shutil.make_archive. It ...READ MORE

Nov 20, 2020 in Python by Niroj
• 82,880 points
644 views
0 votes
1 answer

banking marketing domain

Hi, @Ghazala, What is your exact query here? ...READ MORE

Oct 12, 2020 in Python by Gitika
• 65,910 points
644 views
0 votes
1 answer

how do i change to lowercase letters in strings?

use lower() for lowercasing.example: "ALIREZA".lower() > ...READ MORE

Apr 15, 2019 in Python by Alireza Bahrami
644 views
0 votes
1 answer

how to delete a file in python?

to delete a file import os os.remove('filename') this will delete ...READ MORE

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

GAE: python code to check if i'm on dev_appserver or deployed to appspot

I don't know if you still need ...READ MORE

Sep 11, 2018 in Python by anonymous
644 views
0 votes
1 answer

How to replace all occurrences of a string?

The general pattern is str.split(search).join(replacement) This used to be ...READ MORE

Nov 26, 2020 in Python by Gitika
• 65,910 points
643 views
+1 vote
0 answers

how can read text from website ??

from selenium import webdriver import time query = ('maps') if ...READ MORE

Jan 7, 2020 in Python by anonymous
• 130 points
643 views
0 votes
1 answer

*args and **kwargs in python

In cases when we don’t know how ...READ MORE

Jul 20, 2018 in Python by Priyaj
• 58,090 points
643 views
0 votes
0 answers

Error: current transaction is aborted, commands ignored until end of transaction block?

I got a lot of errors with ...READ MORE

Aug 3, 2020 in Python by kartik
• 37,510 points
642 views
0 votes
1 answer

How is lambda() used with map() in python?

The map() function in Python takes in ...READ MORE

May 20, 2019 in Python by Takeshi
642 views
0 votes
1 answer

How to call function in django ?

Hi, @Hari, Are you facing any error while ...READ MORE

Oct 12, 2020 in Python by Gitika
• 65,910 points
641 views
0 votes
1 answer

how to create a password in python 1 alphabet 1 digit 1character

You can make use of this:  ^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*()_+])[A-Za-z\d][A-Za-z\d!@#$%^&*()_+]{7,19}$ [A-Za-z\d] Ensures that ...READ MORE

Sep 18, 2020 in Python by Roshni
• 10,520 points
641 views
0 votes
1 answer

NameError on coding

well i think the sapi5 is not ...READ MORE

Jun 28, 2020 in Python by Shaurya Thapliyal
• 340 points
641 views
+1 vote
1 answer

How to modify list while iterating?

Hi, You can try slice operator mylist[::3] to skip across to ...READ MORE

Jul 5, 2019 in Python by Taj
• 1,080 points
641 views
0 votes
1 answer

how easy is yaml to work with in python compared to json?

Hi, First thing YAML and JSON are not ...READ MORE

Dec 16, 2020 in Python by MD
• 95,440 points
640 views
+1 vote
1 answer

How to change the order of DataFrame columns in pandas?

Hi@akhtar, You can rearrange a DataFrame object by ...READ MORE

Oct 20, 2020 in Python by MD
• 95,440 points
640 views
0 votes
1 answer

Create an ec2 instance using boto

Hi @Neel, try this script: reservations = conn.get_all_instances(instance_ids=[sys.argv[1]]) instances ...READ MORE

Jun 24, 2019 in Python by Varsha
640 views
0 votes
1 answer

Python in Windows Store apps

I have ported the Python interpreter to ...READ MORE

Aug 9, 2019 in Python by SDeb
• 13,300 points
639 views
0 votes
1 answer

Need help with Tkinter window formatting using Python

Tkininter comes with the columnspan argument to span the labels ...READ MORE

Sep 7, 2018 in Python by aryya
• 7,450 points
639 views
0 votes
1 answer

How to exit from Python without traceback?

shutil has many methods you can use. One ...READ MORE

May 11, 2018 in Python by charlie_brown
• 7,720 points
639 views
+1 vote
0 answers

taking partial screenshot with python selenium in linux [closed]

is it possible to take screenshot of ...READ MORE

Jan 21, 2020 in Python by Noor
• 200 points

closed Jan 21, 2020 by Kalgi 638 views
0 votes
1 answer

.replace() regex in Python

No,  .replace() does not support regex. Regular expressions ...READ MORE

Nov 26, 2018 in Python by SDeb
• 13,300 points
638 views
+1 vote
0 answers

Select by date to change value

df_subset looks like this: ...READ MORE

Nov 9, 2019 in Python by Gkeace
• 130 points
637 views
0 votes
1 answer

How to encode Python source code?

Python allows you to encode the source ...READ MORE

May 14, 2019 in Python by Jimmy
637 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
636 views
0 votes
2 answers

what is the procedure to the version of python in my computer?

Execute the following command on your terminal: python ...READ MORE

Mar 20, 2019 in Python by Alia
636 views
+1 vote
2 answers

Best Python Programming Courses

you can also check http://letsfindcourse.com/python for best ...READ MORE

May 15, 2019 in Python by anonymous
636 views
0 votes
1 answer

Submit bug reports - Python

To report a bug, you can use the ...READ MORE

Jun 6, 2019 in Python by Nisha
635 views
0 votes
0 answers

How to mix read() and write() on Python files in Windows

It appears that a write() immediately following a read() on a ...READ MORE

Oct 24, 2018 in Python by Aryya
• 500 points
635 views
0 votes
1 answer

how to manage memory in python?

Memory management in python involves a private heap ...READ MORE

May 21, 2019 in Python by Mohammad
• 3,230 points
633 views
0 votes
1 answer

How does % work in Python?

The % (modulo) operator yields the remainder ...READ MORE

Oct 10, 2018 in Python by SDeb
• 13,300 points
633 views
0 votes
0 answers

How to create Personalised QR code using Python?

How to read and generate QR codes ...READ MORE

Nov 27, 2020 in Python by kartik
• 37,510 points
632 views
0 votes
1 answer

is it possible to create zip of a directory in Python?

Please go through this code. This should ...READ MORE

Jul 10, 2019 in Python by Arvind
• 3,040 points
632 views
0 votes
1 answer

Cannot make connection to .accdb file using python

key is just a variable name. for key in ...READ MORE

Sep 21, 2018 in Python by charlie_brown
• 7,720 points
632 views
0 votes
1 answer

Pandas vs NumPy

Pandas should be used when you are ...READ MORE

Nov 18, 2019 in Python by Aman
631 views
0 votes
1 answer

How to capture exception message in Python

You have to define which type of ...READ MORE

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

Avoiding multiple nested for-loops in python

You can replace the three loops with: from ...READ MORE

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

What is the preferred way to concatenate strings in python??

If the strings you are concatenating are ...READ MORE

Dec 21, 2018 in Python by charlie_brown
• 7,720 points
630 views
0 votes
1 answer

LightFM does the training set need to be the same size as the test set?

I would change the wording. Often in ML, ...READ MORE

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

Make a unix alias with python script

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

Sep 10, 2018 in Python by Priyaj
• 58,090 points
630 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 627 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,210 points
626 views
0 votes
1 answer

Download a file over HTTP using Python

In Python 2, use urllib2 which comes ...READ MORE

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

How to check the version of Python?

you can check the version of python ...READ MORE

Sep 25, 2018 in Python by SDeb
• 13,300 points
626 views
0 votes
1 answer

How to concatenate Pandas dataframes?

Suppose you have 3 dataframes named df1, ...READ MORE

May 14, 2019 in Python by Rasheed
625 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
625 views
0 votes
1 answer

Python division

You're using Python 2.x, where integer divisions ...READ MORE

Oct 13, 2018 in Python by SDeb
• 13,300 points
625 views