Most viewed questions in Python

0 votes
1 answer

How to concatenate items in a list to a single string?

Hello @kartik, Use join: >>> sentence = ['this','is','a','sentence'] >>> '-'.join(sentence) 'this-is-a-sentence' Hope it ...READ MORE

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

What is the Python 3 equivalent of “python -m SimpleHTTPServer”

The SimpleHTTPServer module has been merged into http.server in Python 3.0. ...READ MORE

Nov 28, 2020 in Python by Gitika
• 65,910 points
486 views
0 votes
1 answer

How to fill a list?

Consider the usage of extend: >>> l = [] >>> ...READ MORE

Jun 14, 2019 in Python by SDeb
• 13,300 points
486 views
0 votes
1 answer

Alternative to Double Iteration

You don't have to find the removed ...READ MORE

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

How to find packages installed using pip?

Yes, you can find the packages installed ...READ MORE

Jan 29, 2019 in Python by Omkar
• 69,230 points
486 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
484 views
0 votes
1 answer

hclust size limit?

Classic hierarchical clustering approaches are O(n^3) in ...READ MORE

Jul 10, 2019 in Python by SDeb
• 13,300 points
484 views
0 votes
1 answer

Variables in Python

Variables in python work differently than they ...READ MORE

Apr 26, 2018 in Python by Nietzsche's daemon
• 4,260 points
484 views
0 votes
1 answer

Is it possible to make android apps using python?

Yes, of course, it's possible. PyMob is ...READ MORE

May 31, 2019 in Python by Umer
483 views
0 votes
1 answer

What is the syntax to compare boolean value in Python?

The opposite of dest in lower.keys() is dest not in ...READ MORE

Aug 21, 2019 in Python by Neel
• 3,020 points
482 views
0 votes
0 answers

where and how can i use PYTHONPATH in python?

is there a particular syntax for this?? READ MORE

Apr 8, 2019 in Python by Waseem
• 4,540 points
482 views
0 votes
2 answers

Delete a character from pythons string

If you want to remove the 'J' ...READ MORE

Jun 12, 2018 in Python by anonymous
482 views
0 votes
1 answer

FileNotFound error

PATH is an issue here. It should ...READ MORE

Oct 16, 2020 in Python by anonymous
• 65,910 points
481 views
0 votes
1 answer

Python: list of lists

Lists are a mutable type - in ...READ MORE

Aug 2, 2018 in Python by bug_seeker
• 15,520 points
481 views
0 votes
1 answer

Understanding the map function

map isn't particularly pythonic. I would recommend ...READ MORE

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

How to take user input python3?

Use a while True: loop, to take input forever, ...READ MORE

Nov 4, 2020 in Python by anonymous
• 65,910 points
480 views
0 votes
1 answer

Stop while loop and continue click on next page of table

Hey, @Vishal,  Python provides two keywords that terminate ...READ MORE

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

How to write a regular expression in Python?

The following code should be able to ...READ MORE

Jul 30, 2019 in Python by Arvind
• 3,040 points
480 views
0 votes
0 answers

How to handle large files using file handling in python?

I have used file handling for smaller ...READ MORE

Aug 2, 2019 in Python by Waseem
• 4,540 points
479 views
0 votes
1 answer

How to generate a string token using four of this items random?

One approach just generates random integers up ...READ MORE

Nov 16, 2020 in Python by Gitika
• 65,910 points
478 views
0 votes
1 answer

How to create lambda function inside a list in Python?

Hi@akhtar, The lambda statement can appear in places ...READ MORE

Jun 25, 2020 in Python by MD
• 95,440 points
478 views
0 votes
0 answers

What is the type-error in python?

How to resolve this error, or keep ...READ MORE

Jul 31, 2019 in Python by Waseem
• 4,540 points
478 views
0 votes
1 answer

Pandas row in printing whole structure instead of value.

Try this code, it should print only ...READ MORE

Mar 28, 2019 in Python by Siri
478 views
0 votes
0 answers

How can I add indexes of similar values from two .csv to each of them?

So I have two csv files: csv1.csv: 2010-12-10, Steve, ...READ MORE

Aug 13, 2020 in Python by Alex
• 120 points
477 views
0 votes
1 answer

How can I remove the first element in the list?

suppose you have a list with the ...READ MORE

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

How to make a password validator without the use of the any()?

Hi, @There, Regarding your query I would suggest ...READ MORE

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

I m begginer,is the python harder than java and html ??

Hey, @Shuddh,  Its upon your interests that what ...READ MORE

Apr 15, 2020 in Python by Gitika
• 65,910 points
475 views
0 votes
1 answer

How to print the full traceback without halting the program?

Hello @kartik, When you don't want to halt ...READ MORE

Jun 5, 2020 in Python by Niroj
• 82,880 points
474 views
0 votes
1 answer

How to convert a dataframe into list?

Hi@akhtar, You can convert your dataframe into list. ...READ MORE

Apr 25, 2020 in Python by MD
• 95,440 points
474 views
0 votes
1 answer

Copy object in Python

In general, copy.copy() or copy.deepcopy() works perfectly ...READ MORE

Jul 25, 2019 in Python by Tanishq
474 views
0 votes
1 answer

boolean in Python

True ... and False obviously. checker = None # not necessary if ...READ MORE

Nov 2, 2018 in Python by Priyaj
• 58,090 points
474 views
0 votes
1 answer

vim creating alias for frequently used command

You can add the following to your ...READ MORE

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

How can I print literal curly-brace characters in python string and also use .format on it?

You need to double the {{ and }}: >>> x = ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,910 points
472 views
0 votes
0 answers

Why I'm Getting ValueError?

Here is my code: import pandas as p import ...READ MORE

Nov 28, 2020 in Python by Rohan
• 200 points

edited Nov 30, 2020 by Niroj 472 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 472 views
+1 vote
1 answer

How do I trim whitespace?

Whitespace on both sides: s = " \t ...READ MORE

Aug 20, 2018 in Python by Priyaj
• 58,090 points
472 views
0 votes
1 answer

What is the difference between Python's list methods append and extend?

Python's list methods append and extend add ...READ MORE

Feb 9, 2022 in Python by Nandini
• 5,480 points
471 views
0 votes
0 answers

How to write this condition in one line and run this.

Hello, I have a dataframe that contain ...READ MORE

Sep 7, 2020 in Python by moli
• 140 points
471 views
0 votes
1 answer

SKLearn NMF Vs Custom NMF

The choice of the optimizer has a ...READ MORE

Sep 7, 2018 in Python by Priyaj
• 58,090 points
471 views
0 votes
0 answers

Print multiple arguments in Python

This is my code: print("Total score for %s ...READ MORE

Apr 25, 2022 in Python by Kichu
• 19,050 points
469 views
0 votes
0 answers

How do you install Tkinter in python?

What is the basic function of Tkinter ...READ MORE

Jun 24, 2019 in Python by Waseem
• 4,540 points
469 views
0 votes
1 answer

Integrating Python code in .NET / Java

Hi,@Rajeshmthakkar, Jython is a Python interpreter implemented in ...READ MORE

Jul 27, 2020 in Python by Gitika
• 65,910 points
468 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
468 views
0 votes
1 answer

how to execute python scripts in windows?

On Windows, To run a python module without typing "python", --> ...READ MORE

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

In 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

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

Looping over a string in python

for c in "string": ...READ MORE

May 28, 2018 in Python by Nietzsche's daemon
• 4,260 points
468 views
0 votes
1 answer

Number division in python

For Python 3, use the // operator: q = ...READ MORE

Apr 18, 2018 in Python by Nietzsche's daemon
• 4,260 points
468 views
0 votes
1 answer

Is there anyway to get the total count of times of a Generator?

Generators are originally created to return an ...READ MORE

Nov 6, 2020 in Python by Gitika
• 65,910 points
467 views
0 votes
0 answers

i would like assistance on my code after i input: y = data.temp x = data.drop('temp', axis=1)

This error appeared:      Traceback (most recent call ...READ MORE

Jul 30, 2019 in Python by mimo
467 views
0 votes
1 answer

Suing multiple lambda functions together

Yes, lambda functions can be used within ...READ MORE

Jul 26, 2019 in Python by Wajiha
• 1,950 points
467 views