Trending questions in Python

0 votes
1 answer

How do I include related model fields using Django Rest Framework?

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

Jul 1, 2020 in Python by Niroj
• 82,880 points
3,346 views
+1 vote
1 answer

understand this error:AttributeError: 'Turtle' object has no attribute 'Listen'. Any ideas?

Hey, @Mohammed, You are getting this error because ...READ MORE

May 20, 2020 in Python by Gitika
• 65,910 points
5,096 views
0 votes
1 answer

Error:No module named pkg_resources

Hello @kartik, This error occur if the requirements.txt contains a ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,880 points
3,543 views
0 votes
1 answer

How can I optimize this condition so that it takes less time to execute in Python Pandas.

Hello @moli, You can easily optimize this code ...READ MORE

Sep 8, 2020 in Python by Niroj
• 82,880 points
333 views
0 votes
2 answers

Run a python script that automates create operation of 10000 entries in mongodb on spring tool suite

You can write a simple loop to ...READ MORE

Aug 24, 2020 in Python by Richa sharma
931 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,175 views
0 votes
1 answer

How to check if any value is NaN in a Pandas DataFrame?

Hello @kartik, If you need to know how ...READ MORE

Jun 15, 2020 in Python by Niroj
• 82,880 points
3,943 views
0 votes
1 answer

How to create an empty NumPy array?

Hey, @Roshni, To create an empty array with ...READ MORE

Jun 24, 2020 in Python by Gitika
• 65,910 points
3,577 views
+1 vote
1 answer

AttributeError: 'numpy.ndarray' object has no attribute 'append'

Hi, You created two empty list. And in ...READ MORE

May 17, 2020 in Python by MD
• 95,440 points
5,114 views
0 votes
1 answer

How to save one list in a text file in Python?

Hi@akhtar, There is no inbuilt function available to ...READ MORE

Jun 25, 2020 in Python by MD
• 95,440 points
3,454 views
0 votes
1 answer

Python Error: Can't find '_main_' module in 'C:/Users/DELL/Pythonprojects/Aks'

I can see there no Python file ...READ MORE

Jun 25, 2020 in Python by Karan
• 19,610 points
3,452 views
0 votes
0 answers
0 votes
0 answers

AttributeError: 'DataFrame' object has no attribute 'is_impossible'

from collections import Counter import re import numpy as ...READ MORE

Mar 10, 2020 in Python by Mohammed
• 120 points

edited Mar 11, 2020 by Gitika 8,078 views
0 votes
1 answer

how can i extact all the links from a website using python and save it in a csv file ?

Hi, @Shubham, Web scraping is the technique to ...READ MORE

Jun 16, 2020 in Python by Gitika
• 65,910 points
3,816 views
0 votes
1 answer

How to create Bubble Chart using Pandas?

Hi@akhtar, You can use scatter function in Pandas. ...READ MORE

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

Python interpreter error: I have installed Python 3.8 but it shows version 3.7

Hi, While installing Python 3.8 there was a box ...READ MORE

Jul 2, 2020 in Python by Gitika
• 65,910 points
3,235 views
0 votes
1 answer

How do I use the built in password reset/change views with my own templates?

Hello @kartik, You'll notice that password_reset takes a named parameter ...READ MORE

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

avro schema validation with shuffled columns

I want to validate my incoming Avro ...READ MORE

Aug 22, 2020 in Python by khyati
• 190 points
871 views
0 votes
1 answer

how do i get anova table of split plot design or factorial experimental design in python?

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

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

How to produce a list with unique elements from a list with duplicate elements?

Hey, @Roshni, Iterating the list is not a ...READ MORE

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

ModuleNotFoundError: No module named 'bitcoin'

Hi@akhtar, It seems this module is not available ...READ MORE

Jul 23, 2020 in Python by MD
• 95,440 points
2,022 views
0 votes
1 answer

How to check the memory usage of an object in python

Hi, @Roshni, You can use this code below: import ...READ MORE

Jun 26, 2020 in Python by Gitika
• 65,910 points
3,209 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,134 views
0 votes
1 answer

Error:django.core.exceptions.ImproperlyConfigured

Hello @kartik, You can set fields or exclude ...READ MORE

Jul 3, 2020 in Python by Niroj
• 82,880 points
2,871 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,141 views
0 votes
1 answer

How to make the user in a model default to the current user?

Hello @kartik, You have to override get_changeform_initial_data method in your ...READ MORE

Jun 12, 2020 in Python by Niroj
• 82,880 points
3,720 views
0 votes
1 answer

How to query as GROUP BY in django?

Hii, Django does not support free group by ...READ MORE

Apr 23, 2020 in Python by Niroj
• 82,880 points
5,875 views
0 votes
1 answer

How to allow users to change their own passwords in Django?

Hello @kartik, See the Changing passwords section Navigation to your project ...READ MORE

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

How do I read CSV data into a record array in NumPy?

Hello @kartik, You can use Numpy's genfromtxt() method to do ...READ MORE

Jun 22, 2020 in Python by Niroj
• 82,880 points
3,261 views
0 votes
1 answer

correct use of random.seed() in reading a text file

Hi, @Flygen, Seeding a pseudo-random number generator gives ...READ MORE

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

Need help with the output of a code snippet.

If you write x.insert(2,3) and then print x ...READ MORE

Jun 23, 2020 in Python by Viraj Doshi
3,129 views
0 votes
0 answers

How do I clone a Django model instance object and save it to the database?

In the database, I want to add ...READ MORE

Jun 22, 2020 in Python by kartik
• 37,510 points
3,159 views
0 votes
1 answer

ModuleNotFoundError: No module named 'pyGTK'

Hi@akhtar, It seems you didn't install this module ...READ MORE

Jun 29, 2020 in Python by MD
• 95,440 points
2,797 views
0 votes
1 answer

While working on VIF in multiple regression I came across this problem

Hello, @Pawan, The as_matrix method is deprecated since 0.23.0, so ...READ MORE

Aug 11, 2020 in Python by Dhiman
971 views
0 votes
1 answer

How to get the ASCII values of a character in python?

You can get the ASCII value of ...READ MORE

Aug 23, 2020 in Python by Sajetha Selva
9,097 views
0 votes
1 answer
0 votes
1 answer

How to test an API endpoint with Django-rest-framework using Django-oauth-toolkit for authentication?

Hello @kartik, You should avoid making unneeded API calls, ...READ MORE

Jul 2, 2020 in Python by Niroj
• 82,880 points
2,611 views
0 votes
1 answer

How to send image to firebase using python in raspberry pi?

Here's a code snippet demonstrating the same. # ...READ MORE

Jun 23, 2020 in Python by Sam
• 6,260 points
2,957 views
0 votes
1 answer

Where can I find the error logs of nginx, using FastCGI and Django?

Hello @kartik, Errors are stored in the nginx ...READ MORE

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

How to override the default value of a Model Field from an Abstract Base Class

Hello @kartik, You can do this as follows: class ...READ MORE

Jun 30, 2020 in Python by Niroj
• 82,880 points
2,619 views
0 votes
1 answer

How to count the frequency of the words in the file in Python?

Hi@akhtar, You can use the Counter module to ...READ MORE

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

What is difference between "inplace = True" and "inplace = False?

Hi, Both inplace= true and inplace = False ...READ MORE

Aug 9, 2019 in Python by Taj
• 1,080 points
16,646 views
0 votes
1 answer

ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

Hello @kartik, The following code works: >>> from django.template ...READ MORE

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

How can I upgrade specific packages using pip and a requirements file?

Hello @kartik, According to pip documentation example 3: pip install --upgrade ...READ MORE

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

can you give an example to get a random sample dictionary?

Check below code thisdict = { "1": ...READ MORE

Nov 25, 2021 in Python by anonymous
393 views
0 votes
1 answer

How to secure APIs for Registration and Login in Django Rest Framework?

Hello @kartik, you cannot have an authentication system ...READ MORE

Jun 25, 2020 in Python by Niroj
• 82,880 points
2,675 views
0 votes
1 answer

How do I migrate a model out of one django app and into a new one?

Hello @kartik, Try this: from south.db import db from south.v2 ...READ MORE

Aug 12, 2020 in Python by Niroj
• 82,880 points
629 views
+1 vote
1 answer

Error:<map object at 0x7fa3435f3048> is not JSON serializable

Hello @kartik, map() in Python 3 is a generator ...READ MORE

Jul 3, 2020 in Python by Niroj
• 82,880 points
2,318 views
0 votes
1 answer

please explain me what does i-1 in python user_define function

i - 1 is the index of ...READ MORE

Jun 28, 2020 in Python by Shaurya Thapliyal
• 340 points
2,631 views