Trending questions in Python

0 votes
0 answers

I am trying to print each entry of the dataframe separately. The dataframe is created by the following code

import pandas as pd XYZ_web = {'Day':[1,2,3,4,5,6], 'Visitors':[1000,700,6000,1000,400,350], ...READ MORE

Jan 27, 2020 in Python by solo
• 120 points
647 views
0 votes
1 answer

How to access table which is in web (using html) and how to get the data of the table using python

Hey. You can use requests and beautifulsoup ...READ MORE

Oct 29, 2019 in Python by Shri
4,478 views
0 votes
1 answer

Use two different programs in the third

You can treat each python file as ...READ MORE

Jan 24, 2020 in Python by Priya
722 views
0 votes
1 answer

How do I draw a semi-circle only using turtle - Python

Try this: import turtle turtle = turtle.Pen() turtle.left(90) for x in ...READ MORE

Jul 6, 2019 in Python by Bheem
9,378 views
+2 votes
0 answers

unsupported operand type error

tech_list=closingdata.pct_change() tech_list READ MORE

Jan 26, 2020 in Python by Anupriya
• 140 points
474 views
0 votes
1 answer

What exactly is invalid syntax error?

please solve this error   def TakeImages():     Id=(text.get())   ...READ MORE

Jul 20, 2020 in Python by Prince kumar
1,598 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 631 views
+1 vote
1 answer

I have explained my scenario.Please suggest answer for this?

Hi @Vishal, You can simply use an if-else ...READ MORE

Jan 22, 2020 in Python by Kalgi
• 52,360 points
508 views
0 votes
2 answers

how can i randomly select items from a list?

You can also use the random library's ...READ MORE

Apr 9, 2020 in Python by Patrick
4,862 views
+1 vote
2 answers

python nmap can't find PortScanner attribute

you want install        1.pip uninstall nmap        2.pip install python-nmap in ...READ MORE

Jan 25, 2020 in Python by Rangertech_hacker234
8,021 views
+1 vote
1 answer

How to convert records from csv to a list in Python?

If you are using Python 3.x then ...READ MORE

Jun 25, 2019 in Python by Arvind
• 3,040 points

edited Jun 26, 2019 by Kalgi 9,533 views
0 votes
2 answers

How to lock a thread in Python?

Lock objects can release the lock at ...READ MORE

Jul 23, 2020 in Python by sahil
• 580 points
670 views
0 votes
1 answer

Install python using Ansible

Try something like: - hosts: all remote_user: ...READ MORE

Jul 22, 2019 in Python by Travis
8,368 views
0 votes
1 answer

Copy constructor vs constructor

Constructor: It is a method which has the ...READ MORE

Aug 14, 2019 in Python by Wajiha
• 1,950 points
7,359 views
0 votes
1 answer

How Do You Run A Python Script In Blender?

Blender is a free and open-source 3D ...READ MORE

Jul 30, 2019 in Python by Mohammad
• 3,230 points
7,962 views
0 votes
1 answer

how do i get the list of all the keys in my dictionary?

my_dict = {'one': 'first', 'two': 'second', 'three': ...READ MORE

Sep 30, 2020 in Python by VJ_python
523 views
–1 vote
1 answer

Python error saying "NameError: name 'email' is not defined"

you need to define the variable email READ MORE

Nov 29, 2019 in Python by Casper
• 160 points
6,341 views
0 votes
1 answer

draw polygon based on user input - turtle python

Try something like this: import turtle # create a ...READ MORE

Jul 6, 2019 in Python by Umer
8,938 views
0 votes
1 answer

BeautifulSoup: How to get the text between p tag?

Find all the the paragraph tags and ...READ MORE

Apr 3, 2019 in Python by Esha
12,922 views
+1 vote
1 answer

How to check if a string is null in python

Try this: if cookie and not cookie.isspace(): # the ...READ MORE

Aug 20, 2018 in Python by Priyaj
• 58,090 points
22,652 views
0 votes
2 answers

How do you read from a file using file handling in python?

for write, read,append data in file check ...READ MORE

Jun 21, 2020 in Python by sahil
• 580 points
895 views
0 votes
1 answer

What is the difference between 2*2 and 2**2 in python?

2*2 is a multiplication operation output will ...READ MORE

Apr 12, 2020 in Python by Hari
1,752 views
0 votes
1 answer

How to get permutations of list or a set in Python?

Permutation is an arrangement of objects in ...READ MORE

Jul 11, 2019 in Python by Neel
• 3,020 points
8,556 views
0 votes
1 answer

how can i use the sum function in a python list?

If there is list =[1,2,4,6,5] then use ...READ MORE

Apr 23, 2020 in Python by anonymous
3,464 views
+1 vote
0 answers

how to match the following string without a regular expression in python

abc_pqr_0_114_004.xxx ab_pq_04_114.xxx READ MORE

Dec 17, 2019 in Python by Rajesh Babu
• 130 points
1,552 views
+1 vote
1 answer

Python: How to convert text to csv rows separated by a record separator?

Hi @Sumanth, try something like this: import csv with ...READ MORE

Dec 17, 2019 in Python by Pri
1,590 views
0 votes
1 answer

Python error "ImportError: No module named SpeechRecognition"

Hi @Hannah, replace  import SpeechRecognition as sr with import speech_recognition ...READ MORE

Oct 3, 2019 in Python by Yamini
4,779 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
619 views
0 votes
1 answer

How to install openssl in python?

pip install openssl-python run this command in the ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
7,883 views
+2 votes
1 answer

Create column for str,contain in pandas

Hi Juzar So if I am not wrong ...READ MORE

Jan 6, 2020 in Python by Kalgi
• 52,360 points
539 views
0 votes
2 answers

Finding local IP addresses using Python's stdlib

import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s ...READ MORE

Mar 30, 2020 in Python by anonymous
2,582 views
0 votes
2 answers

How to define a class in python?

Class use the special word  class for declaration. ...READ MORE

Jun 6, 2020 in Python by anonymous
• 580 points
833 views
0 votes
1 answer

USING LIKE inside pandas.query()

If you have to use df.query(), the ...READ MORE

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

How to find if a value exists in Pandas dataframe?

Try this:​ for name in df['Name']: ...READ MORE

Apr 8, 2019 in Python by Tina
12,271 views
0 votes
0 answers

attribute error in python

i kept getting attribute error in my ...READ MORE

Dec 23, 2019 in Python by anonymous
• 120 points
1,130 views
+7 votes
4 answers

What's the coolest thing you've ever done using Python?

Python is an extremely interesting language. you ...READ MORE

Nov 27, 2019 in Python by Tini
1,866 views
0 votes
1 answer

How to Pivot pandas for removing of some headers and renaming of some indexes?

Solution is add parameter values to pivot, then add reset_index for column ...READ MORE

Sep 27, 2018 in Python by Priyaj
• 58,090 points
20,559 views
+1 vote
1 answer

instead of using two for loops in python

This example might help: for x, y in ((a,b) ...READ MORE

Dec 24, 2019 in Python by Sumeir
924 views
0 votes
1 answer

How to web scrape using python without using a browser?

Yes, you can use the headless mode. ...READ MORE

Apr 2, 2019 in Python by Yogi

edited Oct 7, 2021 by Sarfaraz 12,398 views
0 votes
1 answer

Python strftime- date without leading 0?

If you add a hyphen between the ...READ MORE

Dec 31, 2018 in Python by SDeb
• 13,300 points
16,311 views
+2 votes
2 answers

Google search using Python

import webbrowser search=input('Search: ') webbrowser.open('https:// ...READ MORE

Dec 25, 2019 in Python by Makhmudov
2,405 views
0 votes
1 answer

SyntaxError: Missing parentheses in call to "print".

The statement print "hello python" does not work in ...READ MORE

Jul 16, 2019 in Python by Umar
7,710 views
0 votes
1 answer

Python Selenium: ConnectionRefusedError: No connection could be made because the target machine actively refused it

When you use driver.quit(), it closes the ...READ MORE

Apr 6, 2019 in Python by Tina
12,086 views
0 votes
2 answers

How can I get the count of a list in Python?

n=[1,2,3,4,5,6,7,8,9] print(len(n)) =9 READ MORE

Dec 10, 2020 in Python by anonymous
1,167 views
0 votes
1 answer

I am trying to view and preprocess a .mhd and .raw image types on jupyter notebook, but I am getting a syntax error.

Hey @tekle,  You cannot use a string in ...READ MORE

Nov 4, 2019 in Python by Payal
2,824 views
0 votes
1 answer

How to run a Function in Spyder and check output?

You will see the output of the ...READ MORE

May 17, 2019 in Python by Omkar
• 69,210 points
10,210 views
0 votes
2 answers

How can I rename multiple files in a certain directory using Python?

import os from optparse import OptionParser, Option class MyOption ...READ MORE

Jul 29, 2020 in Python by The real slim shady
4,422 views
0 votes
1 answer

Is there a scanf() or sscanf() equivalent in python?

There is nothing as such for python. For ...READ MORE

Jul 30, 2019 in Python by Greg
6,733 views
–1 vote
1 answer

nmap.nmap.PortScannerError: 'nmap program was not found in path

python-nmap module used in python happens to use nmap binary ...READ MORE

Jan 30, 2019 in Python by Omkar
• 69,210 points
14,488 views