Trending questions in Python

0 votes
1 answer

Check python object's data type

Hi @hannah, that's pretty simple. To check ...READ MORE

Nov 18, 2019 in Python by Eric
717 views
+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
732 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,711 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
20,230 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
647 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,936 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,305 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,909 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
802 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,778 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,536 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 5,009 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,219 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,701 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
6,030 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
690 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,336 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,788 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 640 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
551 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,490 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,314 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,089 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,866 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,637 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,886 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,541 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,208 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,796 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,213 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,153 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,926 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,777 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,436 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,962 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,346 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,481 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
6,099 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,907 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,521 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,409 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
4,034 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,353 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,770 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,207 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,589 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,726 views
0 votes
1 answer

PyCharm type hinting weirdness

This looks like a bug in PyCharm. ...READ MORE

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

How to open gmail and other menus from Google Apps menu using python selenium

You have to add implicit wait until ...READ MORE

Jul 31, 2019 in Python by Rishi
3,759 views
0 votes
1 answer

Install virtualenv - python

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

Oct 7, 2019 in Python by Harshit
818 views