Most viewed questions in Python

0 votes
1 answer

How to find index from raw and column in python?

You probably want to use np.ravel_multi_index: import numpy as ...READ MORE

Sep 12, 2018 in Python by Priyaj
• 58,090 points
684 views
0 votes
1 answer

How is Python 2.7.3 and Python 3.3 different?

raw_input() is not used in Python 3. Use input()  ...READ MORE

Sep 12, 2018 in Python by SDeb
• 13,300 points
684 views
0 votes
1 answer

How to find all occurrences of a substring?

There is no simple built-in string function ...READ MORE

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

How are Python and Anaconda Related?

Anaconda is a free and open-source Python ...READ MORE

Oct 30, 2018 in Python by SDeb
• 13,300 points
683 views
0 votes
1 answer

How to create MySql database using Python?

Hi@akhtar, You need to use MySQL connector in ...READ MORE

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

video streaming using cv2 module in python.

Hi@akhtar, Yes, you can use cv2 module for ...READ MORE

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

How do you break out of a while loop in python?

Usually the execution moves out of the ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
682 views
0 votes
1 answer

Python Null Object

Use the 'None' keyword to denote the ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
682 views
0 votes
0 answers
0 votes
1 answer

How to split a string into a list?

You can use the function  text.split() This should be ...READ MORE

Jul 30, 2018 in Python by Priyaj
• 58,090 points
679 views
0 votes
1 answer

Unable to create EC2 instance using boto3

Hi@Pradeep, I have tried the below code and ...READ MORE

Jul 13, 2020 in Python by MD
• 95,440 points
677 views
0 votes
1 answer

How to download a file over HTTP using Python?

In Python 2, use urllib2 which comes ...READ MORE

Oct 18, 2018 in Python by SDeb
• 13,300 points
675 views
0 votes
0 answers

how to write unittest cases for stock prediction data

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

Feb 20, 2020 in Python by Vasu
• 140 points
673 views
0 votes
1 answer

Count words in a string in Python

You have to use the count method to ...READ MORE

Apr 4, 2019 in Python by Shri
673 views
0 votes
1 answer

ImportError: No module named requests

Hello, To install requests module for Python2: $ sudo apt-get install ...READ MORE

Nov 20, 2020 in Python by Niroj
• 82,880 points
672 views
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
670 views
0 votes
1 answer

Spell Checker for Python

This function, in particular, has the ideas ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,700 points
669 views
0 votes
0 answers

How can we pass a variable value in python GOTO statement?

Alias is a runtime argument the value ...READ MORE

Feb 5, 2020 in Python by neppoliean
• 120 points
669 views
0 votes
0 answers

how can i make a python chatbot

can you give me any reference to ...READ MORE

Apr 12, 2019 in Python by Waseem
• 4,540 points
669 views
0 votes
1 answer

Linux command-line call not returning what it should from os.system?

What gets returned is the return value ...READ MORE

Aug 29, 2018 in Python by Priyaj
• 58,090 points
669 views
0 votes
1 answer

Checkers that can check hints in python source code

Static type checkers such as Mypy, Pyre, ...READ MORE

Jun 7, 2019 in Python by Fez
668 views
0 votes
1 answer

Does python support the concept of global variables?

In Python, a variable declared outside of ...READ MORE

Mar 12, 2019 in Python by rajesh kumar
668 views
0 votes
1 answer

what are "and" and "or" operators in Python?

AND - True if both the operands ...READ MORE

Apr 18, 2018 in Python by Johnathon
• 9,090 points
668 views
0 votes
1 answer

What is the difference between staticmethod and classmethod?

A staticmethod is a method that knows nothing about ...READ MORE

Dec 18, 2018 in Python by abc
667 views
+2 votes
0 answers

I don't want to seem like a begger, but I've been working on this code for the past 3 days and made 0 progress.

Basically, my code runs a turtle and ...READ MORE

Nov 26, 2019 in Python by Kyler
• 140 points
666 views
0 votes
1 answer

DatabaseError: current transaction is aborted, commands ignored until end of transaction block?

Hello @kartik, To get rid of the error, roll ...READ MORE

May 6, 2020 in Python by Niroj
• 82,880 points
664 views
0 votes
0 answers

Dickey-Fuller test in Python

Dear all, I'm trying to reproduce one of ...READ MORE

Feb 5, 2021 in Python by Marcelo
• 120 points
663 views
0 votes
0 answers

What is pythonanywhere?

What is it used for ? Is ...READ MORE

May 13, 2019 in Python by Waseem
• 4,540 points
662 views
0 votes
1 answer

What does ' -> ' mean in Python function definitions?

It's a function annotation. In more detail, Python 2.x ...READ MORE

May 23, 2018 in Python by charlie_brown
• 7,720 points
662 views
0 votes
1 answer

Programmatically generate video or animated GIF in Python?

You can use  ImageMagick. Save your frames ...READ MORE

Apr 25, 2022 in Python by narikkadan
• 63,700 points
661 views
0 votes
1 answer

K-means or Hierarchical clustering?

You can use hierarchical clustering for this ...READ MORE

Feb 14, 2019 in Python by Dinesh
661 views
0 votes
1 answer

How can I remove a trailing newline?

Try the method rstrip() (see doc Python 2 and Python 3) >>> 'test ...READ MORE

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

Why are Python lambdas useful?

The main purpose of anonymous functions come ...READ MORE

Jun 19, 2019 in Python by Wajiha
• 1,950 points
659 views
0 votes
1 answer

MemoryError binary data storage

The problem occurs when you are using ...READ MORE

Dec 26, 2018 in Python by SDeb
• 13,300 points
659 views
0 votes
1 answer

Why feed_dict is constructed when running epoch in PTB tutorial on Tensorflow?

Q1. feed_dict is used in this case to set ...READ MORE

Oct 3, 2018 in Python by Priyaj
• 58,090 points
659 views
0 votes
1 answer

Pygtk color for drag_highlight

To make the line around the EventBox, ...READ MORE

Mar 7, 2019 in Python by SDeb
• 13,300 points
658 views
+1 vote
3 answers

PYTHON: Who could help?

A quick solution is to use the collections ...READ MORE

Nov 26, 2018 in Python by Omkar
• 69,230 points
658 views
0 votes
1 answer

How to Reverse a list in Python

You can use the reversed function in ...READ MORE

Sep 29, 2018 in Python by SDeb
• 13,300 points
658 views
0 votes
1 answer

What does super() function do in python?

Super function calls the parent class method ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
657 views
0 votes
1 answer

What is GIL in CPython?

Python's GIL is intended to serialize access ...READ MORE

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

How to create login user using Django Rest Framework?

Hello @Reebika , For you query you can refer ...READ MORE

Oct 12, 2020 in Python by Niroj
• 82,880 points
656 views
0 votes
0 answers

How to solve UTF-8 error

Hi, im getting a problem when executing ...READ MORE

Mar 26, 2020 in Python by skaailet
• 120 points
656 views
0 votes
1 answer

What is the easiest way to concatenate two lists in Python?

You can use the + operator to combine them: list1 ...READ MORE

Sep 16, 2019 in Python by Neel
• 3,020 points
656 views
0 votes
1 answer

what is a split function in python?

use of split function in python  At some ...READ MORE

Apr 22, 2019 in Python by rajesh
• 1,270 points
656 views
0 votes
1 answer

Python: Module vs package?

A package is represented by an imported ...READ MORE

Nov 13, 2018 in Python by Priyaj
• 58,090 points
656 views
0 votes
1 answer

what is an else if statement in python?

if condition:    statement elif condition:     statement #this is how you use ...READ MORE

Mar 15, 2019 in Python by Waseem
• 4,540 points
655 views
0 votes
0 answers

TypeError: unsupported operand type(s) for *: 'CommentedMap' and 'CommentedMap' Hatam bu nasıl çözebilirim ?

from ruamel import yaml from scipy import spatial import ...READ MORE

Sep 29, 2020 in Python by anonymous
• 120 points

edited Sep 29, 2020 by Gitika 654 views
0 votes
1 answer

Pyomo parallel processing to solve an instance

Depends on the solver and the model. ...READ MORE

Sep 11, 2018 in Python by Priyaj
• 58,090 points
654 views
0 votes
1 answer

Count elements in list

Try the following method: len() >>> someList=[] >>> ...READ MORE

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

How to replace all occurrences of a string?

The general pattern is str.split(search).join(replacement) This used to be ...READ MORE

Nov 26, 2020 in Python by Gitika
• 65,910 points
650 views