Trending questions in Python

+1 vote
0 answers

How to make python selenium program to perform certain actions depending upon the web interface response?

Hi All, I am trying to download files ...READ MORE

Nov 17, 2019 in Python by varunanand
• 130 points
709 views
+1 vote
1 answer

Not able to Import scikitplot package in my Jupyter Lab

To overcome this issue, you need to ...READ MORE

Feb 21, 2019 in Python by Yami
12,243 views
0 votes
1 answer

While accessing array elements, which is better Pandas or NumPy?

Hi @Hannah, Panda series objects are more ...READ MORE

Nov 18, 2019 in Python by Eric
619 views
0 votes
1 answer

Can some one explain k-means algorithm with examples?

What is K-means Clustering? K-means (Macqueen, 1967) is ...READ MORE

Sep 10, 2019 in Python by Arvind
• 3,050 points
3,625 views
0 votes
1 answer

Python: For loop to iterate class object

Refer to the below code: class Try: ...READ MORE

May 22, 2019 in Python by Raj
8,252 views
0 votes
1 answer

Flask App Using WTForms with SelectMultipleField

Flask returns request.form as a werkzeug MultiDict ...READ MORE

Aug 23, 2018 in Python by aryya
• 7,460 points
19,983 views
0 votes
1 answer

Pass --no-deps in PIP requirements.txt

There is no such option yet for ...READ MORE

Jun 25, 2019 in Python by SDeb
• 13,300 points
6,710 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
783 views
0 votes
1 answer

Difference between constructor and method

Method: It a function which is the member ...READ MORE

Aug 14, 2019 in Python by Wajiha
• 1,960 points
4,492 views
0 votes
1 answer

What does the penup() do in Python(turtle module)

penup() basically makes sure that the moving ...READ MORE

Jun 21, 2019 in Python by Iris
6,794 views
0 votes
1 answer

Python error "Python NameError: global name 'Thread' is not defined"

There is a built-in function with the ...READ MORE

May 31, 2019 in Python by Riya
7,596 views
0 votes
1 answer

How to print like printf in Python3?

To print like printf in Python you ...READ MORE

Jul 25, 2019 in Python by Wajiha
• 1,960 points
5,142 views
0 votes
2 answers

How to check whether a string contains alphabets or number in Python?

By using isAlpha () to check whether ...READ MORE

Jul 14, 2019 in Python by Sheik janibasha
5,622 views
0 votes
1 answer

I am new to Python and trying to get enter in Software domain . Kindly suggest me some major helpful tips

Hi @Rahul. I have been a Python ...READ MORE

Nov 6, 2019 in Python by Sushmita
651 views
0 votes
1 answer

Python error "IndexError: Cannot choose from an empty sequence"

Hi @Isha, According to your error  File ...READ MORE

Jul 5, 2019 in Python by Patric
5,925 views
+1 vote
0 answers

ValueError help with Simple Exponential Smoothing analysis on my data set.

I'm very new, and attempting to teach ...READ MORE

Jul 31, 2019 in Python by Declan

edited Jul 31, 2019 4,821 views
0 votes
0 answers

Difference in the output of NMF.fit and NMF.transform function . Explain the interpretation of the output.

Nov 6, 2019 in Python by Neha
• 120 points

recategorized Nov 6, 2019 by Omkar 607 views
0 votes
0 answers

How can we save the extracted file in a specified folder?

While extracting the data using python selenium, ...READ MORE

Nov 7, 2019 in Python by moumita
• 120 points
530 views
0 votes
1 answer

Convert python code into lambda function

This should work: add = lambda x, y ...READ MORE

May 23, 2019 in Python by Payal
7,718 views
+1 vote
1 answer

Python code to determine its day or night

Try something like this: sample data: (timezone= utc/zulutime) ...READ MORE

Jun 21, 2019 in Python by Imran
6,414 views
0 votes
1 answer

how to check the syntax of python program without running the program?

Yes, it is possible to check the ...READ MORE

Jun 27, 2019 in Python by Arvind
• 3,050 points
6,156 views
0 votes
0 answers

convert following json to csv using recursively

{  "name": "flare",  "children": [   {    "name": "analytics",    "children": [     {      "name": "cluster",      "children": [       {"name": ...READ MORE

Oct 18, 2019 in Python by ÂbhIshëk
• 120 points
1,282 views
0 votes
1 answer

How to create a train and test sample from one dataframe using pandas?

Hi, The below written code can help you ...READ MORE

Jul 4, 2019 in Python by Taj
• 1,080 points
5,827 views
0 votes
2 answers

How to use virtual environment in Python?

venv (for Python 3) and virtualenv (for Python 2) allow ...READ MORE

Aug 25, 2020 in Python by Pistle
• 300 points
1,010 views
0 votes
1 answer

How to plot a histogram when you have two variables on the same side? two graphes in the same chart?

You don't have to use two charts. ...READ MORE

Aug 19, 2019 in Python by Daniel
3,815 views
0 votes
1 answer

How do I make one turtle follow another turtle in python?

Try something like this: from turtle import Turtle, ...READ MORE

Jul 8, 2019 in Python by Ayushi
5,553 views
+1 vote
1 answer

How to print a pyramid of asterisks in Python?

This is one of the most frequently ...READ MORE

Aug 1, 2019 in Python by Neel
• 3,020 points
4,479 views
0 votes
1 answer

Speech recognition code - Python

Hi Hannah,  Have a look at this code: import ...READ MORE

Oct 3, 2019 in Python by Waseem
1,772 views
0 votes
1 answer

Sort (hex) colors to match rainbow

Here's a function that, given a color ...READ MORE

Jul 17, 2019 in Python by SDeb
• 13,300 points
5,128 views
0 votes
2 answers

Python UnboundLocalError error while executing script

Inside your function when you say word=word+1, ...READ MORE

May 22, 2020 in Python by Ibrahim Nezar
• 140 points
2,131 views
0 votes
1 answer

Difference between function and generator?

Normal Functions vs Generator Functions: Generators in Python ...READ MORE

Jul 15, 2019 in Python by Wajiha
• 1,960 points
5,091 views
0 votes
1 answer

How to write a python script for downloading a video from YouTube and saving it to a directory?

First download pytube using the following code  pip ...READ MORE

Sep 4, 2019 in Python by Neel
• 3,020 points
2,870 views
0 votes
1 answer

Execute PHP code in Python

Try the following Code: import subprocess # if the ...READ MORE

Dec 11, 2018 in Python by SDeb
• 13,300 points
14,364 views
0 votes
1 answer

'NodeList' object has no attribute 'firstChild'

Use the following piece of code: from xml.dom ...READ MORE

Jul 22, 2019 in Python by Wajiha
• 1,960 points
4,697 views
0 votes
1 answer

Is it possible to find the source code of built-in functions of Python?

Since Python is open source you can ...READ MORE

Jul 17, 2019 in Python by Neel
• 3,020 points
4,895 views
+1 vote
2 answers

Python convert extracted excel file to csv

Some services require table data in CSV ...READ MORE

Aug 30, 2019 in Python by Mian Tanzeel
7,242 views
0 votes
1 answer

Python error "AttributeError: '_Screen' object has no attribute 'onkeypress'"

Instead of  wn.onkeypress(go_up, "w") Try wn.onkey(go_uo, " ...READ MORE

Jul 5, 2019 in Python by Pooja
5,361 views
0 votes
1 answer

How to write a regular expression to check whether an input is an identifier or not?

As per the documentation, an identifer can ...READ MORE

Aug 8, 2019 in Python by Neel
• 3,020 points
3,849 views
0 votes
1 answer

Python error "ValueError: size needs to be (int width, int height)" while using pygame.Surface

pygame.Surface takes in integer values for building ...READ MORE

Jun 19, 2019 in Python by Varsha
5,995 views
0 votes
1 answer

How do I check if input string is a valid regular expression or not in Python?

Hi. Good question! Well, just like what ...READ MORE

Feb 12, 2019 in Python by Nymeria
• 3,560 points
11,442 views
0 votes
1 answer

Installing package not found in conda

You can install pip in your conda env and then run pip ...READ MORE

Jul 31, 2019 in Python by SDeb
• 13,300 points
3,964 views
0 votes
1 answer

How to suppress console output in Python?

You can try the following block of ...READ MORE

Jun 7, 2019 in Python by SDeb
• 13,300 points
6,278 views
0 votes
2 answers

Manually raising (throwing) an exception in Python

Exception handling issues in python can easily ...READ MORE

Jan 18, 2019 in Python by nick
• 140 points
17,663 views
0 votes
1 answer

How to import json file to mongodb using pyspark (or python)?

You can use the same format as ...READ MORE

Sep 9, 2019 in Python by Karan
2,152 views
0 votes
1 answer

how to find files and skip directories in os.listdir

You need to filter out directories; os.listdir() ...READ MORE

Mar 6, 2019 in Python by SDeb
• 13,300 points
10,139 views
0 votes
1 answer

Can I build a plagiarism checker using python?

Hey @Alessha, you can use an SDK ...READ MORE

Aug 5, 2019 in Python by Kalgi
• 52,350 points
3,557 views
0 votes
1 answer

Install virtualenv - python

Follow these steps to install virtualenv on ...READ MORE

Oct 7, 2019 in Python by Harshit
790 views
0 votes
1 answer

better way to drop nan rows in pandas

Use dropna: dat.dropna() You can pass param how to drop if all ...READ MORE

Jul 9, 2019 in Python by SDeb
• 13,300 points
4,672 views
0 votes
1 answer

How do I use urllib to see if a website is 404 or 200 in Python?

For Python 3, try doing this: import urllib.request, ...READ MORE

Nov 29, 2018 in Python by Nymeria
• 3,560 points

edited Dec 11, 2018 by Nymeria 14,233 views
0 votes
1 answer

How can I change the iteration variable inside a for loop in python?

Assume you have a list of lists: my_list ...READ MORE

Jun 10, 2019 in Python by Shubham Bansal
5,842 views