Trending questions in Python

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,840 points
569 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,770 points
3,865 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,460 points
2,569 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,770 points
3,729 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,763 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,840 points
1,195 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,840 points
4,300 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,890 views
0 votes
0 answers
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,840 points
3,327 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,158 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,770 points
1,997 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,770 points
5,153 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,840 points
1,493 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,668 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,770 points
3,551 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,840 points
1,470 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,840 points
1,479 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,320 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,395 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,481 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,840 points
3,601 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,382 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,490 views
0 votes
1 answer
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,840 points
1,079 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,840 points
5,768 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,840 points
3,172 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,840 points
3,065 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,467 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,218 views
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
14,727 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,840 points
1,442 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,365 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,840 points
1,361 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,291 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,840 points
3,076 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,840 points
1,033 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,840 points
1,248 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,840 points
3,018 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,840 points
2,662 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
17,624 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,306 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,840 points
3,005 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,840 points
1,085 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,770 points
5,133 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
635 views
0 votes
0 answers

How can I add indexes of similar values from two .csv to each of them?

So I have two csv files: csv1.csv: 2010-12-10, Steve, ...READ MORE

Aug 13, 2020 in Python by Alex
• 120 points
857 views
0 votes
1 answer

How to access a module written in Python from C?

Hey, @Roshni: You can access a module written ...READ MORE

Jun 26, 2020 in Python by Gitika
• 65,770 points
2,816 views