Trending questions in Python

0 votes
1 answer

How to print just one column in pandas?

You can use the header to print ...READ MORE

Apr 4, 2019 in Python by TIna
10,823 views
0 votes
1 answer

How do I draw a hexagon using the turtle module of python?

Hey @Jinu, try this: import turtle polygon = ...READ MORE

Jun 23, 2019 in Python by Haseeb
7,373 views
0 votes
1 answer

How to get the multiplication table of any number using list comprehension?

Hey @Neha, you can use something like ...READ MORE

Jul 8, 2019 in Python by Sakshi
6,680 views
0 votes
1 answer

Pandas vs NumPy

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

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

What kind of data suits pandas the most?

Pandas can handle almost all kinds of ...READ MORE

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

How do I create a dataframe using a dictionary in pandas?

Hi @Hannah, You need to define your dictionary ...READ MORE

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

Python error "TypeError: Cannot compare types 'ndarray(dtype=int64)' and 'str'"

Hey @Ashish, change the emotion_map to the ...READ MORE

May 30, 2019 in Python by Mir
8,148 views
0 votes
1 answer

How to find path of Python interpreter?

In Python, the sys module has System-specific ...READ MORE

Jul 26, 2019 in Python by Arvind
• 3,050 points
5,674 views
0 votes
1 answer

Python error "AttributeError: '_Screen' object has no attribute 'mainloop'" python module turtle

Hey @Nagya, replace  wn.mainlopp() with turtle.mainloop() ...READ MORE

Jun 19, 2019 in Python by Faiza
7,255 views
0 votes
1 answer

Open a file if it exists or create and open it does not exists - Python

You can use this: f = open("ex.txt","w+") Here the ...READ MORE

Jun 20, 2019 in Python by Jason
7,205 views
0 votes
0 answers

Python error "IndexError: list index out of range"

I am trying to execute the following ...READ MORE

Jun 17, 2019 in Python by Alok
7,382 views
0 votes
0 answers

Operands Could not be Broadcast with Shapes (19,)(0,) — KNN

I am working on how to use ...READ MORE

Nov 10, 2019 in Python by sam
• 120 points
1,101 views
0 votes
0 answers

Can not fetch data from Google fire store

i have https domain with django platfrom ...READ MORE

Nov 18, 2019 in Python by anonymous
• 120 points
681 views
0 votes
0 answers

How to save the import csv file to mongodb using pyspark (or python)?

I have this code, and I want ...READ MORE

Oct 9, 2019 in Python by Ahmed
• 310 points
2,401 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
650 views
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
607 views
0 votes
2 answers

Django forms in ReactJs

Did you ever find a solution for ...READ MORE

Feb 6, 2020 in Python by martin
3,173 views
0 votes
1 answer

Difference between ElementTree and Minidom

Python allows parsing these XML documents using ...READ MORE

Jul 22, 2019 in Python by Wajiha
• 1,960 points
5,694 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
537 views
0 votes
1 answer

Python error "AttributeError: 'str' object has no attribute 'casefold'"

Check your python version. Casefold is possible ...READ MORE

Jul 4, 2019 in Python by Yesha
6,400 views
0 votes
1 answer

What is the use of Tkinter,Flask and Django? What is the main use of them? Can any of them help me in freelancing?

Hey, all the tools that you have ...READ MORE

Feb 27, 2019 in Python by Priyaj
• 58,020 points
11,823 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,010 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,394 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,150 views
0 votes
1 answer

Python error "ImportError: No module named pygame.locals"

You need to download and install the ...READ MORE

Jun 18, 2019 in Python by Greg
6,959 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
728 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,415 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,646 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,528 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
587 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,291 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
482 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 540 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,301 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,390 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
4,892 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,217 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,745 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,223 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,631 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,482 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,523 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,717 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,361 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
819 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,634 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,356 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
4,928 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
1,949 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
5,726 views