Most viewed questions in Python

0 votes
1 answer

Error Code installing Scrapy

You can install it via pip wheel. Download ...READ MORE

Jan 17, 2019 in Python by SDeb
• 13,300 points
1,161 views
0 votes
2 answers

Do-while loop in Python

A more pythonic way would be this: ``` while ...READ MORE

Jul 6, 2020 in Python by Composer3
1,161 views
0 votes
1 answer

More Pythonic way of counting things in a heavily nested defaultdict

You can try the following, this might ...READ MORE

Jun 20, 2019 in Python by SDeb
• 13,300 points
1,159 views
0 votes
1 answer

How can I use the power function in python 2.7?

print(pow(3,4)) #this will return the exponentiation of 3 ...READ MORE

May 21, 2019 in Python by Mohammad
• 3,230 points
1,159 views
0 votes
1 answer

Python table gives NaN when initialized with series

The NaN value you are getting is ...READ MORE

Jul 9, 2019 in Python by Yogi
1,148 views
0 votes
0 answers

Bash Commands in Jupyter Notebook

Is it possible to use bash commands ...READ MORE

Mar 28, 2019 in Python by Mishti
• 480 points
1,146 views
0 votes
1 answer

ImportError: No module named pandas

 I just had the problem and I ...READ MORE

Feb 17, 2022 in Python by Aditya
• 7,680 points
1,141 views
0 votes
1 answer

what does a conditional operator in python do?

Conditional operators in python is same as ...READ MORE

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

I'm using Python 2.7 to convert an XML response (from a REST call to Atlassian Fisheye) into an HTML table.

You don't have a template matching tabularQueryResult in your ...READ MORE

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

How to manage development and production settings in django?

Hello @kartik, I usually have one settings file ...READ MORE

Aug 12, 2020 in Python by Niroj
• 82,880 points
1,137 views
0 votes
2 answers

How to implement Stack in python

There are different method to implement stack ...READ MORE

Jun 21, 2020 in Python by pagarsach
• 160 points
1,135 views
0 votes
1 answer

Remove all special characters, punctuation and spaces from string

This can be done without regex: >>> string ...READ MORE

Feb 14, 2022 in Python by CoolCoder
• 4,400 points
1,134 views
0 votes
0 answers

Does Python's SQLAlchemy support server side cursor?

I want to query a MSSQL database ...READ MORE

May 8, 2019 in Python by ana1504.k
• 7,910 points
1,134 views
0 votes
1 answer

Game is not starting from PyGame?

It seems to me like someone made ...READ MORE

Sep 28, 2018 in Python by Priyaj
• 58,090 points
1,134 views
+1 vote
1 answer

What is the function for Factorial in Python

Easiest way: math.factorial(x) (available in 2.6 and ...READ MORE

Aug 21, 2018 in Python by Priyaj
• 58,090 points

edited Aug 21, 2018 by Omkar 1,134 views
0 votes
1 answer

How do I check if a string contains a specific word?

You can use the strpos() function which is used ...READ MORE

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

Iterating over multiple lists

import itertools for item in itertools.chain(listone, listtwo): #li ...READ MORE

Apr 25, 2018 in Python by Nietzsche's daemon
• 4,260 points
1,125 views
0 votes
0 answers

dlib installation on Windows 10

 I have the python app running great ...READ MORE

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

Disadvantages of using PyMob

There are many disadvantages of using PyMob: The framework ...READ MORE

May 31, 2019 in Python by Tamanna
1,124 views
0 votes
0 answers

TypeError: 'type' object is not subscriptable when indexing in to a dictionary

I use dict to shorten things as ...READ MORE

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

How to inject errors into already validated form?

Hello @kartik, For Django 1.7+, you should use form.add_error() instead ...READ MORE

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

Selecting Pandas Columns by dtype

You can use the following: df.loc[:, df.dtypes == ...READ MORE

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

How to use Euler's number and power operation?

You can refer the math library of ...READ MORE

Dec 31, 2018 in Python by SDeb
• 13,300 points
1,117 views
0 votes
3 answers

Is python version 3.7.2 supported by pycharm jetbrains IDE?

Yes it works fine.. READ MORE

Feb 28, 2019 in Python by Pratosh kumar
1,115 views
+2 votes
2 answers

In a list of dictionaries, how can I find the minimum calue in a common dictionary field.

There are several options. Here is a ...READ MORE

Apr 10, 2018 in Python by charlie_brown
• 7,720 points
1,114 views
0 votes
2 answers

What is the difference between python lists and arrays?

Python arrays and lists have the same ...READ MORE

Jun 11, 2019 in Python by Nisa
• 1,090 points
1,113 views
0 votes
1 answer

pip install web2py

You don't need to install web2py, just ...READ MORE

Mar 20, 2019 in Python by SDeb
• 13,300 points
1,109 views
0 votes
2 answers

what is null in python?

In python no primitive data types. python treats as ...READ MORE

Mar 13, 2019 in Python by rajesh kumar
1,109 views
0 votes
1 answer

pip wheel conditional dependencies

With the latest version (2017) of the ...READ MORE

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

Shortest path from source to and from a negative cycle using Bellman Ford in Python

class NegativeWeightFinder: def __init__(self, graph: nx.Graph): ...READ MORE

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

Best library for reading meta-data

You can use PowerShell to implement ID3 ...READ MORE

Oct 31, 2018 in Python by nirvana
• 3,130 points
1,106 views
0 votes
1 answer

Which IDE can be used for Python on Mac OS X

Have tried many different (Kate, Eclipse, Scite, ...READ MORE

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

How to get the size of a string in Python?

If you are talking about the length ...READ MORE

Jun 4, 2018 in Python by aryya
• 7,450 points
1,104 views
0 votes
0 answers

Load and pre-process NSL_KDD data set

since I am a newbie in python ...READ MORE

May 27, 2020 in Python by arezoo
• 220 points
1,103 views
0 votes
1 answer

Create a database table using python

Hey @Kim, try something like this: import MySQLdb # ...READ MORE

Jul 23, 2019 in Python by Barbara
1,102 views
0 votes
1 answer

Interactive Ipython Notebooks on Heroku

From what I understand, you have 2 ...READ MORE

Apr 11, 2019 in Python by SDeb
• 13,300 points
1,100 views
+4 votes
1 answer

Counting integers that are within intervals

Am not sure as this would give ...READ MORE

Sep 27, 2018 in Python by bug_seeker
• 15,520 points
1,100 views
0 votes
1 answer

How can I run Jupyter code on Pycharm?

You can do this by installing the ...READ MORE

Aug 8, 2019 in Python by Zulaikha
• 910 points
1,099 views
0 votes
1 answer

How to expose std::pair to python using boost::python?

The most simple example of exposing std::pair is: class_<std::pair<int, int> ...READ MORE

Jun 20, 2019 in Python by SDeb
• 13,300 points
1,099 views
0 votes
1 answer

Error:Pip install Matplotlib error with virtualenv

Hello @kartik, To generate graph in png format ...READ MORE

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

Convert list into dict in Python

Try using the below-mentioned code, it should ...READ MORE

Jul 24, 2019 in Python by Banu
1,098 views
+1 vote
1 answer

WindowsError: [Error 126] The specified module could not be found.

Hi@akhtar, You can download the shapely module in ...READ MORE

Jul 13, 2020 in Python by MD
• 95,440 points
1,097 views
0 votes
2 answers

Pick a random item from the list - Python

You can also use secrets.choice() import secrets list = ...READ MORE

May 28, 2019 in Python by Kim
1,097 views
0 votes
1 answer

what is attribute error in python?

import pandas df = pd.read_csv('filename') it will give attribute ...READ MORE

Mar 27, 2019 in Python by Mohammad
• 3,230 points
1,097 views
0 votes
1 answer

What does the return statement do in Python?

The print() function is use to write ...READ MORE

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

Derivative of manipulated spline

import numpy as np import matplotlib.pyplot as plt from ...READ MORE

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

How to write a HDF file from a DataFrame?

Hi@akhtar, Hierarchical Data Format (HDF) is a set ...READ MORE

Oct 18, 2020 in Python by MD
• 95,440 points
1,092 views
0 votes
1 answer

Error saying "TypeError: range() integer end argument expected"

Try this: [x * 0.01 for x in ...READ MORE

May 27, 2019 in Python by Keshav
1,092 views
0 votes
1 answer

How to split a large sample of text into words in Python?

Hi@akhtar, You can use nltk module to split your text ...READ MORE

Jun 26, 2020 in Python by MD
• 95,440 points
1,090 views
0 votes
1 answer

How to find cos(60) in radin measure after importing math function

Hi Kushal!  If you have the value of ...READ MORE

Feb 22, 2019 in Python by Omkar
• 69,230 points
1,088 views