Trending questions in Python

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,800 points
6,831 views
0 votes
1 answer

driver.find_elements_by_css_selector("input[placeholder='from']").send_keys("del") AttributeError: 'list' object has no attribute 'send_keys'

Hey, @Nupur, You are getting a list of web elements ...READ MORE

May 20, 2020 in Python by Gitika
• 65,730 points
5,665 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,800 points
849 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,730 points
4,150 views
0 votes
0 answers

How to write this condition in one line and run this.

Hello, I have a dataframe that contain ...READ MORE

Sep 7, 2020 in Python by moli
• 140 points
922 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,730 points
2,461 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,800 points
4,608 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,550 points
4,014 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,800 points
1,448 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
17,815 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,800 points
3,549 views
0 votes
0 answers
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,730 points
3,859 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,954 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
1,861 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
1,391 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
3,823 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,800 points
1,736 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,800 points
1,732 views
0 votes
1 answer

How can I get dict from sqlite query?

Hii, Even using the sqlite3.Row class-- you still ...READ MORE

Apr 30, 2020 in Python by Niroj
• 82,800 points
6,215 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,800 points
1,703 views
0 votes
1 answer
0 votes
1 answer

python error "AttributeError: 'NoneType' object has no attribute 'read'"

The microphone needs to be entered using ...READ MORE

Oct 3, 2019 in Python by Jack
15,239 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,460 points
3,539 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,800 points
3,524 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,800 points
3,832 views
0 votes
1 answer

How to count the number of elements in a list?

1) Count total number of numbers in ...READ MORE

Apr 14, 2021 in Python by VISHAKHA AGARWAL

edited Mar 5 5,861 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
3,764 views
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,800 points
3,350 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,800 points
1,324 views
+1 vote
1 answer

How can I build multiple submit buttons django form?

Hiii @kartik, You can use self.data in the clean_email method to access ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,800 points
3,423 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,800 points
1,709 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,800 points
1,670 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,460 points
3,430 views
0 votes
1 answer

How to convert a DictProxy object into JSON serializable dict?

Hello, Rather than using a private DictProxy method like _getvalue(), I'd ...READ MORE

Apr 15, 2020 in Python by Niroj
• 82,800 points
6,538 views
0 votes
1 answer

ImportError Traceback (most recent call last) ImportError: numpy.core.umath failed to import

Hi@akhtar, You need to upgrade your Numpy library. Your ...READ MORE

Jun 23, 2020 in Python by MD
• 95,460 points
3,560 views
0 votes
1 answer

Python error "'Series' object is not callable "

Try this: df['ln_returns'] = np.log(df['Close_mid']/df['Close_mid']) df['Close_mid'](1)) doesn't seem to ...READ MORE

Jul 22, 2019 in Python by Greg
18,046 views
0 votes
1 answer

How to install WordCloud or an equivalent package on Anaconda Python 3.7?

Hey, @Jhonny, Could you please post how did ...READ MORE

May 5, 2020 in Python by Gitika
• 65,730 points
5,606 views
0 votes
1 answer

TypeError: 'Element' object is not subscriptable

Hey Bharti, You can get some idea from ...READ MORE

Feb 18, 2020 in Python by Gitika
• 65,730 points
8,932 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,520 points
3,542 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,800 points
3,354 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,800 points
1,262 views
0 votes
1 answer

How to debug in Django code?

Hello @kartik, There are a bunch of ways ...READ MORE

Aug 6, 2020 in Python by Niroj
• 82,800 points
1,474 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,800 points
2,913 views
0 votes
1 answer

Write code to create a list of word lengths for the words in original_str using the accumulation pattern and assign the answer to a variable num_words_list.

Hi,  num_words_list = len(original_str.split()) original_str.split() - split words in ...READ MORE

May 27, 2020 in Python by Niroj
• 82,800 points
4,492 views
0 votes
1 answer

Python error "pandas.errors.ParserError: Error tokenizing data"

Pandas do not take .xlsx files. Rename ...READ MORE

Jun 13, 2019 in Python by Rhea
19,557 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,800 points
1,364 views
0 votes
1 answer

How to set the encoding for the tables' char columns in django?

Hello @kartik, Django does not specify charset and ...READ MORE

Jun 24, 2020 in Python by Niroj
• 82,800 points
3,249 views
0 votes
1 answer

What is the difference between map() and filter() function in python?

The map() function is a type of ...READ MORE

Jun 25, 2020 in Python by Sirajul
• 59,190 points
3,177 views