Most viewed questions in Python

0 votes
0 answers

Error in Python script "Expected 2D array, got 1D array instead:"?

I wanted to make this ML prediction ...READ MORE

May 18, 2022 in Python by Kichu
• 19,050 points
1,237 views
0 votes
1 answer

How to Specify a mySQL ENUM in a Django model?

Hello @kartik, You can follow this snippet below: MAYBECHOICE ...READ MORE

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

Django Postgresql syncdb error

If you're trying to connect to a ...READ MORE

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

how to get anova table of split plot design in python

Hello @kapil, A split plot design is a ...READ MORE

Aug 24, 2020 in Python by Niroj
• 82,880 points
1,228 views
0 votes
1 answer

How to install pycharm?

PyCharm is one of the most widely ...READ MORE

Jun 23, 2020 in Python by Sirajul
• 59,230 points
1,227 views
0 votes
0 answers

'module' object has no attribute 'PortScanner'

I am trying to run nmap in ...READ MORE

Jan 30, 2019 in Python by Karan
1,226 views
0 votes
1 answer

How can I iterate through two lists in Parallel

You have to use the zip function ...READ MORE

Apr 17, 2018 in Python by anonymous
1,225 views
0 votes
1 answer

How to install pip with Python 3?

If you're running Python 2.7.9+ or Python ...READ MORE

Jan 5, 2021 in Python by Gitika
• 65,910 points
1,224 views
0 votes
1 answer

is there a way to send sql query data from redshift and send the data via email to sns?

I resolved this issue using AWS Glue ...READ MORE

Nov 21, 2020 in Python by Ruben
• 180 points
1,223 views
0 votes
1 answer

floor of a float in python

As long as your numbers are positive, ...READ MORE

Nov 22, 2018 in Python by SDeb
• 13,300 points
1,223 views
0 votes
1 answer

How to access different Anaconda environments from PyCharm for coding in Python?

Hi! In PyCharm, you can add any number ...READ MORE

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

Pyglet Image Rendering

I will assume you have something along ...READ MORE

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

How should I write tests for Forms in Django with Python?

from django.tests import TestCase class MyTests(TestCase): ...READ MORE

Nov 20, 2018 in Python by Nymeria
• 3,560 points
1,215 views
0 votes
1 answer

Python: Copy names from txt file to csv format

Hi@ANAND, It depends on your use case. In ...READ MORE

Jun 10, 2020 in Python by MD
• 95,440 points
1,214 views
0 votes
0 answers

Is it ok to have multiple versions of anaconda installed on our systems?

I have both 2.7 and 3.5 installed ...READ MORE

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

What is the difference between python's file I/O system when using 'w' and 'wb'?

Only in Windows, in the latter case, ...READ MORE

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

How to check if a string contains a substring in Bash?

string='My long string' if [[ $string == ...READ MORE

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

What is the function to randomize the items of a list in-place?

Hello @Roshni, Python has a built-in module called ...READ MORE

Jun 26, 2020 in Python by Gitika
• 65,910 points
1,210 views
0 votes
1 answer

How to connect mail server with smtplib module in python?

Hi@akhtar, You can connect mail server using smtplib ...READ MORE

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

How do I create a constant in Python?

Hello @kartik, No there is not. You cannot ...READ MORE

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

How to drop missing value in python data-frame?

Hi Sarada,  I understand you are having problems with ...READ MORE

May 28, 2019 in Python by sampriti
• 1,120 points
1,206 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,203 views
0 votes
1 answer

Is there a way to store this text in a list using selenium (python)

Try using this code snippet to resolve ...READ MORE

Aug 24, 2020 in Python by Carlos
1,202 views
+2 votes
0 answers

Partial screenshot in Linux with Python Selenium

Taking a partial screenshot of an element by ...READ MORE

Jan 21, 2020 in Python by Noor
• 200 points
1,202 views
0 votes
1 answer

what is a type error in python?

you get a type error when you ...READ MORE

Mar 8, 2019 in Python by Waseem
• 4,540 points
1,202 views
0 votes
1 answer

How to find the index of an item in a list?

One thing that is really helpful in ...READ MORE

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

ImportError: No module named requests

To install requests module on Debian/Ubuntu for Python2: $ sudo ...READ MORE

Sep 11, 2020 in Python by Deming
1,197 views
0 votes
1 answer

Error:Installation Issue with matplotlib Python

Hii @kartik, I assume you have installed the ...READ MORE

May 7, 2020 in Python by Niroj
• 82,880 points
1,197 views
0 votes
1 answer

Underscore _ as variable name in Python

Yep, _ is a traditional name for "don't care" ...READ MORE

Nov 15, 2018 in Python by Nymeria
• 3,560 points
1,197 views
0 votes
1 answer

How do I count the number of times the string (y/n) outputs

Hi, @Reshma, You can go through this as ...READ MORE

Oct 13, 2020 in Python by Lisa sanyal
1,196 views
+2 votes
6 answers

Slicing in Python

Index: ------------> ...READ MORE

Oct 18, 2018 in Python by abc
1,192 views
0 votes
1 answer

Python BeautifulSoup CSS Selector

Yes, you can use the select() method of BeautifulSoup ...READ MORE

May 14, 2019 in Python by Jim
1,190 views
0 votes
0 answers

main function is not working in python

import quandl as Quandl, math import numpy as ...READ MORE

Feb 18, 2020 in Python by Vasu
• 140 points
1,189 views
0 votes
1 answer

Get path from open file in Python

The key here is the name attribute ...READ MORE

Jan 16, 2019 in Python by SDeb
• 13,300 points
1,188 views
0 votes
1 answer

Save NumPy arrays to File

Try this: np.savetxt('file.txt',arr,delimiter=' ') will save to a text ...READ MORE

May 24, 2019 in Python by Jason
1,186 views
+1 vote
1 answer

How to print an error in Python?

For Python 2.6 and later and Python ...READ MORE

Aug 23, 2018 in Python by Priyaj
• 58,090 points
1,185 views
0 votes
0 answers

Automate logging in to MS form using Python

I have to login into the same ...READ MORE

Apr 22, 2022 in Python by Edureka
• 13,620 points
1,183 views
0 votes
1 answer

Reconstruct an array by replacing every element with a[[i-1]%K] - Python

Hey varsha, Have a look at this ...READ MORE

Jun 14, 2019 in Python by Miya
1,183 views
+1 vote
1 answer

how to run list of functions using Thread?

You could import the file with function ...READ MORE

Aug 26, 2019 in Python by Vishaka
1,182 views
0 votes
1 answer

Install Kivy dependencies for OS X?

Without using brew you can install the ...READ MORE

May 31, 2019 in Python by Danica
1,182 views
0 votes
1 answer

How to check latest change time of each file using glob in python?

You can get the changing time from ...READ MORE

Jan 2, 2019 in Python by Omkar
• 69,230 points
1,182 views
0 votes
1 answer

Get object by id()

You'll probably want to consider implementing it ...READ MORE

Feb 20, 2019 in Python by SDeb
• 13,300 points
1,181 views
0 votes
0 answers

How to click on the main menu and sub menu using python script

How to proceed with main menu and ...READ MORE

Oct 6, 2020 in Python by ParthivPatel
• 140 points
1,180 views
0 votes
1 answer

Need help with custom authentication in the Google App Engine using Python

Good question. Django 1.0 was updated recently ...READ MORE

Jan 21, 2019 in Python by Nymeria
• 3,560 points
1,171 views
0 votes
1 answer

Adding new column to existing DataFrame in Python pandas

Use the original df1 indexes to create ...READ MORE

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

How do I generate some random numbers with a distribution using Python?

scipy.stats.rv_discrete is what you ned IMHO. You can supply ...READ MORE

Oct 31, 2018 in Python by Anirudh
• 2,080 points

edited Dec 14, 2018 by Anirudh 1,170 views
0 votes
2 answers

What is difference between genarator and iterator

Hello @ Ramesh Generator Iterator Implemented using a function. Implemented using a ...READ MORE

Aug 17, 2020 in Python by Niroj
• 82,880 points
1,169 views
0 votes
0 answers

where can i get the invoice of the certification that i have taken

Please provide me the invoice of the ...READ MORE

Feb 18, 2020 in Python by Shruthi
• 120 points

recategorized Feb 18, 2020 by Gitika 1,168 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,168 views
0 votes
1 answer

Problem in real time matplotlib plotting

Hi Sucheta, The error I can see in ...READ MORE

May 24, 2019 in Python by sampriti
• 1,120 points
1,163 views