Trending questions in Python

0 votes
1 answer

Importing Image

Hi@Amine, The error is because there is some ...READ MORE

Jun 25, 2020 in Python by MD
• 95,460 points
777 views
0 votes
1 answer

How to create lambda function inside a list in Python?

Hi@akhtar, The lambda statement can appear in places ...READ MORE

Jun 25, 2020 in Python by MD
• 95,460 points
745 views
0 votes
1 answer

Error: import No module name urllib2

Hii, You have to install the modules like bs4, ...READ MORE

May 5, 2020 in Python by Niroj
• 82,840 points
2,918 views
0 votes
1 answer

python JSON only get keys in first level

You just need a simple .keys() >>> dct ...READ MORE

Jan 22, 2019 in Python by SDeb
• 13,300 points
23,168 views
0 votes
1 answer

I have trained a model using machine learning algorithm in python , now i want to create a browser extension of that saved model , Is it possible ??

Hi@Shubham, It may possible. When you saved your ML ...READ MORE

Jun 13, 2020 in Python by MD
• 95,460 points
1,259 views
0 votes
1 answer

Error :on installing matplotlib

Hello @kartik, You had to install libfreetype6-dev and libpng-dev from the repositories. ...READ MORE

May 27, 2020 in Python by Niroj
• 82,840 points
1,955 views
0 votes
1 answer

Can anyone help to write a regular expression to fetch TEST:31275 from the below text?

Try using the following expression: Grep -o "TEST:d+" ...READ MORE

Jun 25, 2020 in Python by Nipul Aglawe
687 views
0 votes
1 answer

How to delete items from a dictionary while iterating over it?

Hii Kartik, You could do it in two ...READ MORE

Apr 30, 2020 in Python by Niroj
• 82,840 points
3,046 views
+1 vote
2 answers

Cannot install tensorflow on 32-bit Python

Unfortunately tensorflow is not supported on 32 ...READ MORE

Jan 13, 2020 in Python by jaakko
• 160 points

edited Apr 18, 2022 by Sarfaraz 12,592 views
0 votes
0 answers

For some reason i cannot click on this element/button and have been trying for hours PLEASE HELP!!

from selenium import webdriver from selenium.webdriver.chrome.options import Options from ...READ MORE

Jun 18, 2020 in Python by Justin
• 140 points

reshown Jun 18, 2020 by Sirajul 961 views
0 votes
2 answers

How do I access command line arguments in Python?

import sys print(sys.argv) More specifically, if you run python example.py ...READ MORE

Jun 25, 2020 in Python by Karan
1,528 views
0 votes
1 answer

Change the window background color using turtle - python

Try this: import turtle #set up the screen wn = ...READ MORE

Jun 19, 2019 in Python by Faiza
16,590 views
0 votes
1 answer

HTML to RTF string using Pandoc(pypandoc)

Hey, @There, Actually there is a simple solution: use ...READ MORE

May 27, 2020 in Python by Gitika
• 65,770 points
1,725 views
0 votes
1 answer

How can we install python in RHEL using CLI?

Run the following command: sudo yum install python3 This ...READ MORE

Jun 23, 2020 in Python by Tanay Singh
552 views
0 votes
1 answer

How to use a dot “.” to access members of dictionary?

Hello @kartik, If you want to pickle your ...READ MORE

Apr 30, 2020 in Python by Niroj
• 82,840 points
2,830 views
0 votes
1 answer

How to make a flat list out of list of lists?

Hello @kartik, You can use itertools.chain(): import itertools list2d = [[1,2,3], ...READ MORE

Jun 5, 2020 in Python by Niroj
• 82,840 points
1,278 views
0 votes
1 answer

I can't get a graph out of my information

Hi@lzzy, According to your error, there is a ...READ MORE

Jun 11, 2020 in Python by MD
• 95,460 points
1,023 views
0 votes
1 answer

Python Error saying "NameError: global name 'true' is not defined"

It's a very small mistake. Change true ...READ MORE

Jun 17, 2019 in Python by Vinayak

edited Oct 7, 2021 by Sarfaraz 16,548 views
0 votes
1 answer

How do I integrate Ajax with Django applications?

Hello @kartik, You don't have to change your ...READ MORE

Jun 22, 2020 in Python by Niroj
• 82,840 points
502 views
0 votes
2 answers

Extracting data from a JSON file in Python

Here is what i found and was ...READ MORE

Nov 27, 2018 in Python by Rupali
29,998 views
0 votes
1 answer

How change title bar background color in python tkinter?

You cant change colour cause its the ...READ MORE

Jun 10, 2020 in Python by bezlin
9,119 views
0 votes
0 answers

How to do proper formatting of XML differences in dictionary using python 3.4.4

Need help in formatting the output. Please ...READ MORE

Jun 19, 2020 in Python by Abhinandan
• 120 points

edited Jun 19, 2020 by Abhinandan 588 views
0 votes
1 answer

How to pretty-print a numpy.array without scientific notation and with given precision?

Hii @kartik, The numpy arrays have the method round(precision) which ...READ MORE

Apr 14, 2020 in Python by Niroj
• 82,840 points
3,373 views
0 votes
0 answers

hello world, somebody can help me to correct this error

for label, value in s.iteritems():     s.set_value(label, ...READ MORE

Jun 6, 2020 in Python by WELL
• 140 points
1,134 views
0 votes
1 answer

How to convert dictionary to JSON?

Hello @kartik, json.dumps() returns the JSON string representation of ...READ MORE

Apr 15, 2020 in Python by Niroj
• 82,840 points
3,276 views
0 votes
1 answer

How to check if a website allows web scraping?

To check if a website allows web ...READ MORE

Jun 14, 2019 in Python by Wajiha
• 1,960 points
16,488 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,509 views
0 votes
1 answer

How to convert one list into generator?

Hi@akhtar, Say, you have one list A. Now convert ...READ MORE

Apr 23, 2020 in Python by MD
• 95,460 points
2,880 views
0 votes
1 answer

Create a constant in Python?

No there is not. You cannot declare ...READ MORE

Aug 24, 2018 in Python by Priyaj
• 58,020 points
29,146 views
0 votes
0 answers

What does NameError: name 'withdrawal' is not defined mean ?

READ MORE

Jun 6, 2020 in Python by Shanice
• 120 points

recategorized Jun 8, 2020 by Gitika 988 views
+1 vote
1 answer

How to save graph using matplotlib library?

Hi@akhtar, You can find one function called savefig ...READ MORE

May 21, 2020 in Python by MD
• 95,460 points
1,533 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,840 points
1,567 views
0 votes
1 answer

How to send email via Django?

Hello @kartik, I use Gmail as my SMTP ...READ MORE

May 6, 2020 in Python by Niroj
• 82,840 points
2,140 views
0 votes
1 answer

How to print the full traceback without halting the program?

Hello @kartik, When you don't want to halt ...READ MORE

Jun 5, 2020 in Python by Niroj
• 82,840 points
680 views
0 votes
0 answers

for label, value in s.iteritems(): s.set_value(label, value+2) s.head()

READ MORE

Jun 6, 2020 in Python by WELL
• 140 points

recategorized Jun 8, 2020 by Gitika 682 views
0 votes
1 answer

How can we install python modules without root access?

Hii, You can run easy_install to install python ...READ MORE

Apr 14, 2020 in Python by Niroj
• 82,840 points
2,882 views
0 votes
2 answers

How to check if a csv file is empty in pandas?

Try this: df = pd.DataFrame(columns=['Name', 'ID', 'Department']) if df.empty ...READ MORE

Jul 1, 2019 in Python by Bob
15,247 views
0 votes
1 answer

How Can I log a Python error with debug information?

Hii, Using exc_info options may be better, to allow you ...READ MORE

May 27, 2020 in Python by Niroj
• 82,840 points
949 views
0 votes
1 answer

How to keep keys/values in same order as declared?

Hello @kartik, Dictionaries will use an order that ...READ MORE

Apr 30, 2020 in Python by Niroj
• 82,840 points
2,104 views
0 votes
1 answer

What is the easiest way to implement 'IN' and 'NOT IN' in Pandas dataframe?

You can use pd.Series.isin. For "IN" use: something.isin(somewhere) Or for "NOT ...READ MORE

Aug 23, 2019 in Python by Arvind
• 3,050 points
12,907 views
0 votes
0 answers

How do I fix this Set function in python?

I have the following code below I ...READ MORE

May 20, 2020 in Python by Olufemiodubote
• 120 points
1,184 views
0 votes
1 answer

How can I save a final model after training it on chunks of data?

Hey, @Anan, When you specify chunk size in a ...READ MORE

Apr 15, 2020 in Python by Gitika
• 65,770 points
2,596 views
0 votes
1 answer

ImportError: matplotlib requires dateutil"

Hi@akhtar, The dateutil module provides powerful extensions to the standard ...READ MORE

Apr 9, 2020 in Python by MD
• 95,460 points
2,859 views
0 votes
1 answer

How to set Colorbar Range in matplotlib using Python

You could scale your data to the ...READ MORE

Nov 22, 2018 in Python by Nymeria
• 3,560 points
24,585 views
0 votes
0 answers

I am trying to build a pong game this is what they showed me.

import turtle wn = turtle.Screen() wn.bgcolor("blue") wn.tracer(0) #Paddle A paddle_a = turtle.Turtle() paddle_a.speed(0) paddle_a.shape("square") paddle_a.color("red") paddle_a.ShapeSize paddle_a.penup() paddle_a.goto(-350, ...READ MORE

May 23, 2020 in Python by Praise
• 120 points

edited May 25, 2020 by Gitika 971 views
0 votes
1 answer

AttributeError: 'module' object has no attribute 'HTTPSConnection'

Hi@akhtar, You have to install openssl and openssl-devel before ...READ MORE

Apr 20, 2020 in Python by MD
• 95,460 points
2,318 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,840 points
1,552 views
0 votes
2 answers

Is it possible to launch python idle from a virtual environment?

Try running the following code. #!/usr/bin/env python """Simple script ...READ MORE

Jun 25, 2020 in Python by Sirajul
• 59,230 points
6,341 views
0 votes
1 answer

how to run test cases of different modules with same marker at a time using pytest

Hey,@Nikitha, Suppose you have multiple files say test_sample1.py, test_sample2.py. To ...READ MORE

Apr 28, 2020 in Python by Gitika
• 65,770 points
1,900 views