Trending questions in Python

0 votes
1 answer

How to convert multiple columns to string in pandas dataframe?

Hi, To convert multiple columns to string, include a list of ...READ MORE

Jul 19, 2019 in Python by Taj
• 1,080 points
28,276 views
0 votes
0 answers

How can I extract specific data from pdf & image using python and also Convert it to csv file?

Suppose we have  a pdf of books ...READ MORE

May 4, 2021 in Python by Edureka
• 120 points

edited 4 days ago 8 views
0 votes
1 answer

How to concatenate strings in django templates?

Hello @kartik, Don't use add for strings, you should define ...READ MORE

Aug 3, 2020 in Python by Niroj
• 82,840 points
11,691 views
0 votes
0 answers

Pandas DataFrame combine rows by column value, where Date Rows are NULL

Scenerio: Parse the PDF Bank statement and ...READ MORE

May 2, 2021 in Python by zeroxlearner

edited 4 days ago 6 views
+1 vote
3 answers

AttributeError: 'module' object has no attribute 'listen"

You'll have to install the pyaudio module ...READ MORE

Oct 3, 2019 in Python by Liala
7,572 views
0 votes
0 answers

I'm new to programming so I want to add the functions in my code to a class so can anyone edit it, because I don't know how to use classes and I need an example.

def displayMenu():     status = input("Are you registered user? ...READ MORE

Apr 30, 2021 in Python by anonymous

edited 4 days ago 13 views
0 votes
1 answer

How do I perform query filtering in django templates?

Hello @KARTIK, Just add an extra template tag ...READ MORE

Jul 4, 2020 in Python by Niroj
• 82,840 points
12,931 views
0 votes
1 answer

I am not able to install pywin32 into my Macos ..I tried all the ways and I could not fix the error...can you please help me

Hello @Harikrishna, For your query you can refer ...READ MORE

Nov 23, 2020 in Python by Niroj
• 82,840 points
6,727 views
0 votes
1 answer

Error:Django Rest Framework — no module named rest_framework

Hello @kartik, You just need to install django ...READ MORE

Jun 25, 2020 in Python by Niroj
• 82,840 points
13,167 views
0 votes
1 answer

How to call function that takes an argument in a Django template?

Hello @kartik, You cannot call a function that ...READ MORE

Jun 23, 2020 in Python by Niroj
• 82,840 points
13,182 views
0 votes
2 answers

Python error "ImportError: No module named 'tkinter'"

sudo apt-get install python3-tk Then, >> import tkinter # ...READ MORE

Nov 9, 2019 in Python by Icetutor
• 160 points
24,858 views
0 votes
0 answers
0 votes
1 answer

How does numpy.newaxis work and when to use it?

Hello, The np.newaxis is generally used with slicing. It indicates ...READ MORE

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

How to change the font size on a matplotlib plot?

Functions dealing with text like label, title, etc. accept ...READ MORE

Jan 4, 2021 in Python by Carlos
4,483 views
0 votes
1 answer

How to install packages using pip according to the requirements.txt file from a local directory?

This works for me: $ pip install -r ...READ MORE

Dec 4, 2020 in Python by Gitika
• 65,770 points
5,859 views
0 votes
0 answers

Python error ValueError size needs to be int width int height while using pygame Surface

I'm trying to make a game on ...READ MORE

Apr 19, 2021 in Python by anonymous

edited 4 days ago 8 views
0 votes
1 answer

What is the difference between pop() and remove()?

Array elements can be removed using pop() ...READ MORE

Jun 20, 2019 in Python by Nisa
• 1,090 points
28,833 views
0 votes
1 answer

How to catch multiple exceptions in one line in python?

From Python Documentation: An except clause may name multiple ...READ MORE

Dec 17, 2020 in Python by Gitika
• 65,770 points
5,237 views
0 votes
0 answers

The program will input a string then display all the letters used in the input with their corresponding number of occurrences in the input.

Sample: Input a String: This is FUN. ...READ MORE

Apr 18, 2021 in Python by anonymous

edited 4 days ago 13 views
0 votes
1 answer

ImportError: No module named pip when trying to install packages

Hello @kartik, I found that on Ubuntu, pip ...READ MORE

May 27, 2020 in Python by Niroj
• 82,840 points
14,005 views
0 votes
0 answers

How to edit a data frame series

I have the below series in a ...READ MORE

Apr 17, 2021 in Python by Edureka

edited 4 days ago 14 views
0 votes
1 answer

TypeError: Expected Ptr<cv::UMat> for argument '%s' ''

src is the first argument to cv2.cvtColor. The error you ...READ MORE

Oct 15, 2020 in Python by anonymous
• 65,770 points
7,894 views
+1 vote
1 answer

Error:Getting Site Matching Query Does Not Exist Error after creating django admin

Hello @kartik, The Site object for your Django project is ...READ MORE

Jun 22, 2020 in Python by Niroj
• 82,840 points
12,796 views
0 votes
1 answer

How to list a column of float values from csv file without importing (Python)

Using the default CSV module Demo: import csv with open(filename, "r") ...READ MORE

Sep 16, 2020 in Python by Rajiv
• 8,870 points
9,120 views
0 votes
1 answer

How to expire session due to inactivity in Django?

Hello @kartik, Expire the session on browser close ...READ MORE

Aug 13, 2020 in Python by Niroj
• 82,840 points
10,558 views
0 votes
0 answers

E: Error, pkgProblemResolver

Good day Please excuse my ignorance as I ...READ MORE

Apr 14, 2021 in Python by gurowar

edited 4 days ago 16 views
0 votes
1 answer

How to look up a dictionary value with a variable in Django template?

Hii @kartik, Write a custom template filter: from django.template.defaulttags ...READ MORE

Aug 3, 2020 in Python by Niroj
• 82,840 points
10,939 views
0 votes
1 answer

How to load Numpy array in Jupyter Notebook?

Hi@akhtar, You can use numpy.load() function to load ...READ MORE

Jun 22, 2020 in Python by MD
• 95,460 points
12,686 views
0 votes
0 answers
0 votes
1 answer

How can I get the username of the logged-in user in Django?

Hello @kartik, You can use the request object ...READ MORE

Jul 29, 2020 in Python by Niroj
• 82,840 points
11,055 views
0 votes
0 answers

No 'Id' in the results of the Orderdict although id field is present in the serializers in Django Rest Framework

I tried to create an update api ...READ MORE

Apr 11, 2021 in Python by anonymous

edited 4 days ago 13 views
0 votes
1 answer
0 votes
1 answer

How to convert list into 2 tuple pair list?

This should work: L = [1, 2, 3, ...READ MORE

Nov 4, 2020 in Python by Gitika
• 65,770 points
6,764 views
0 votes
2 answers

ModuleNotFoundError: No module named 'pythoncom' in pyttsx3

even i faced the same problem ...just ...READ MORE

Jun 2, 2020 in Python by anonymous
14,364 views
0 votes
1 answer

How can I get the absolute URL (with domain) in Django?

Hello @kartik, Use handy request.build_absolute_uri() method on request, pass it ...READ MORE

Aug 6, 2020 in Python by Niroj
• 82,840 points
10,558 views
+1 vote
2 answers

Replace every character of string by character whose ASCII value is K times more than it

Refer below code for your problem statement def ...READ MORE

May 17, 2020 in Python by Kumar Sambhawam

edited May 18, 2020 by Gitika 17,589 views
0 votes
2 answers

ImportError: No system module 'pywintypes' (pywintypes38.dll)

I just copied the DLL pywintypes27.dll in C:\Python27\Lib\site-packages\pywin32_system32. I added it ...READ MORE

Nov 25, 2020 in Python by Roshni
• 10,480 points
5,683 views
0 votes
0 answers

how do i Itterate trough a dictionary for a specific key, then ading it to a new dictionary

i know this is a noob question ...READ MORE

Apr 7, 2021 in Python by Said

edited 4 days ago 13 views
0 votes
0 answers

speech_recognition modulehas not working "audio = r.listen(source)" function.how to make it work?

def command1():          r=sr.Recognizer()     with sr.Microphone() as source:         print(random.choice(m))         r.puase_thresshold=1         sound=r.listen(source)     try:         com =r.recognize_google(sound,language='en-in')         print('user:'+ com ...READ MORE

Apr 7, 2021 in Python by python

edited 4 days ago 13 views
+1 vote
2 answers

sklearn.cross_validation import train_test_split not working

How ever now its in model selection ...READ MORE

Jul 17, 2020 in Python by karthikeyan
18,988 views
0 votes
1 answer

How to return the current user with Django Rest Framework?

Hello @kartik, The best way is to use ...READ MORE

Jun 25, 2020 in Python by Niroj
• 82,840 points
12,278 views
0 votes
0 answers

How to save a file to particular folder using selenium webdriver Chrome?

I'm using selenium webdriver for chrome. My ...READ MORE

Apr 6, 2021 in Python by Pushpa

edited 4 days ago 9 views
0 votes
1 answer

How to find which version of package is installed with pip?

As of pip 1.3, there is a pip show command. $ ...READ MORE

Dec 4, 2020 in Python by Gitika
• 65,770 points
5,231 views
0 votes
1 answer

Getting error "AttributeError: 'Screen' object has no attribute 'title' on line 8"

Hey @TedTickles,  Replace  wn.update() with turtle.up ...READ MORE

Dec 24, 2020 in Python by Gitika
• 65,770 points
4,344 views
0 votes
1 answer

if/else in a list comprehension

You can totally do that. It's just ...READ MORE

Dec 23, 2020 in Python by Gitika
• 65,770 points
4,370 views
+1 vote
2 answers

How to print first character of each word in upper case of a string in Python

text = "this is a sample python ...READ MORE

Jun 22, 2022 in Python by anonymous

edited 3 days ago 12,635 views
0 votes
1 answer

%matplotlib inline SyntaxError: invalid syntax

If you're using Jupyter notebook, just mention this ...READ MORE

Aug 1, 2019 in Python by Merlin

edited Jun 25, 2020 by MD 26,300 views
0 votes
1 answer

shows "name connection not defined"

Hi, @Imthiii, Try removing the bracket you have ...READ MORE

Sep 17, 2020 in Python by Rajiv
• 8,870 points
8,416 views
0 votes
0 answers

How to solve the error of Cant execute the script.

Hey!, I am new to python i ...READ MORE

Mar 31, 2021 in Python by anonymous

edited 4 days ago 10 views
0 votes
0 answers

How to fix AttributeError: 'Turtle' object has no attribute 'xcore'

# setting up the screen import turtle import math wn ...READ MORE

Mar 30, 2021 in Python by Dembabe

edited 4 days ago 13 views