Trending questions in Python

0 votes
1 answer

How to count the NaN values in a column in pandas DataFrame?

Hello @kartik, Lets assume df is a pandas DataFrame. Then, df.isnull().sum(axis = ...READ MORE

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

How to insert an object at a given index in Python?

Hi, @Roshni, I will explain to you with ...READ MORE

Jun 24, 2020 in Python by Gitika
• 65,910 points
1,027 views
0 votes
0 answers

Module not callable in python in the following code?

mport pandas as pd import xlsxwriter as xw input_string ...READ MORE

May 23, 2020 in Python by Ratan
• 120 points
2,443 views
0 votes
1 answer

How to set dataframe based on Index Name & Column name ?

Hi@Gaurav, You can use set_index function in pandas. It allows ...READ MORE

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

How to set up a PostgreSQL database in Django?

Hello @kartik, Steps that I use: - sudo apt-get ...READ MORE

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

ModuleNotFoundError: No module named 'Foundation'

Hi@akhtar, By default Foundation module comes with Anaconda ...READ MORE

Apr 24, 2020 in Python by MD
• 95,440 points
3,579 views
0 votes
1 answer

failed: unable to get local issuer certif icate (_ssl.c:1056)'))'

Hi@akhtar, To avoid this error, you need to ...READ MORE

Apr 22, 2020 in Python by MD
• 95,440 points
3,648 views
0 votes
1 answer

Error:Matplotlib tight_layout() doesn't take into account figure suptitle

Hello, You can simply adjust the coordinates of the ...READ MORE

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

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

Hello @kartik, Just change the primary key of ...READ MORE

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

How to delete column from pandas DataFrame?

Hi@akhtar, You can use the del command in ...READ MORE

Jun 24, 2020 in Python by MD
• 95,440 points
918 views
0 votes
1 answer

Error while installing Django with Anaconda.

This error is probably because you don't ...READ MORE

Jun 24, 2020 in Python by Sirajul
• 59,230 points
895 views
0 votes
1 answer

ImportError: Environment variable DJANGO_SETTINGS_MODULE is undefined

Hello @kartik, You just need to be able to ...READ MORE

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

Error: current transaction is aborted, commands ignored until end of transaction block?

Hello @kartik, To get rid of the error, roll ...READ MORE

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

How to fetch HTML code using urllib module in Python?

Hi@akhtar, You can use urllib module to fetch ...READ MORE

Jun 26, 2020 in Python by MD
• 95,440 points
744 views
+1 vote
0 answers

TypeError: unsupported operand type(s) for /: 'list' and 'list'

This is my part of code, why ...READ MORE

May 17, 2020 in Python by anonymous
• 220 points

edited May 18, 2020 by Gitika 2,457 views
0 votes
1 answer

How to change data types in Pandas DataFrame?

Hi@akhtar, You can use astype function to change ...READ MORE

Jun 23, 2020 in Python by MD
• 95,440 points
892 views
0 votes
1 answer

the syntax getting error solve it please

Hi@shahzad, Your dataset contains a string value. You ...READ MORE

Jun 18, 2020 in Python by MD
• 95,440 points
1,061 views
0 votes
1 answer

How to draw BoxPlot in Python?

Hi Guys, You can use the plot function ...READ MORE

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

How to a write reg expression that confirms an email id using the python reg expression module “re”?

Hey, @Roshni, Python has a regular expression module ...READ MORE

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

Error:Warning:config file server.conf not found

Hello @kartik, By default, informational and debugging messages ...READ MORE

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

How can I disable the Django Celery admin modules?

Hello @kartik, To be more specific, in admin.py of any ...READ MORE

Jun 12, 2020 in Python by Niroj
• 82,880 points
1,274 views
0 votes
0 answers

Python | Combine two bots into one

Hi everyone, Basically i made a bot in ...READ MORE

Jun 30, 2020 in Python by PrKit
• 120 points
516 views
0 votes
1 answer

How to test python code using Pytest?

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

Jun 24, 2020 in Python by MD
• 95,440 points
748 views
0 votes
1 answer

How do you get a list of all the keys in a dictionary?

Hey, @Roshin, I would like to give you ...READ MORE

Jun 23, 2020 in Python by Gitika
• 65,910 points
750 views
0 votes
2 answers

Which IDE should I use for python?

Pycharm or Spyder. You can even use visual ...READ MORE

Jun 23, 2020 in Python by Anjali
702 views
+1 vote
1 answer

How to get the home directory using ‘~’ in Python?

Hello, @Roshni, You need to import the os module, ...READ MORE

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

How to merge two DataFrame in Pandas?

Hi@akhtar, You can use Pandas.merge() function to merge ...READ MORE

Jun 23, 2020 in Python by MD
• 95,440 points
734 views
0 votes
1 answer

NameError on coding

well i think the sapi5 is not ...READ MORE

Jun 28, 2020 in Python by Shaurya Thapliyal
• 340 points
634 views
0 votes
1 answer

How to convert string to date in python with different algorithms ?

Hello @ pagarsach, You can convert a string to ...READ MORE

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

How to remove the last object from a list?

Hi, @Roshni, Try running the following piece of ...READ MORE

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

Error in the Javis Project

what you can do is download the ...READ MORE

Jun 28, 2020 in Python by Shaurya Thapliyal
• 340 points
864 views
0 votes
1 answer

How to create a virtual environment to run a particular version of python?

Hi@akhtar To create a virtual environment, decide upon ...READ MORE

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

How to create the following pattern using Python?

Hi, @Roshni, You can use two for-loops for ...READ MORE

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

How to manage local vs production settings in Django?

Hello @kartik, In settings.py: try: from local_settings ...READ MORE

Jun 22, 2020 in Python by Niroj
• 82,880 points
670 views
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,440 points
530 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
6,129 views
0 votes
1 answer

How do you convert two lists into a dictionary?

There are three different ways of converting ...READ MORE

May 27, 2019 in Python by Taj
• 1,080 points
17,558 views
0 votes
3 answers

'python' is not recognized as an internal or external command

Try "py" instead of "python" from command line: C:\Users\Cpsa>py Python 3.4.1 (v3.4.1:c0e311e010fc, May ...READ MORE

Feb 8, 2022 in Python by Rahul
• 9,670 points
2,100 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,880 points
1,736 views
0 votes
1 answer

How to call an external command from Python?

Hi@akhtar, You can use the os module in ...READ MORE

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

How to use MySQLdb with Python and Django?

Hello @kartik, I had the same error and pip ...READ MORE

Jun 24, 2020 in Python by Niroj
• 82,880 points
521 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,440 points
460 views
0 votes
1 answer

How to transform a Python string into a list?

Hi, @Roshni, You can use Python <split()> function ...READ MORE

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

How to remove a project from Pycharm?

Assuming that you have the project opened ...READ MORE

Aug 2, 2019 in Python by Arvind
• 3,040 points
14,623 views
0 votes
1 answer

Python: Copy names from txt file to csv format

Hi@ANAND, It depends on your use case. In ...READ MORE

Jun 10, 2020 in Python by MD
• 95,440 points
1,193 views
0 votes
1 answer

Error:django-debug-toolbar breaking on admin while getting sql stats

Hello @kartik, You just need to be able ...READ MORE

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

How to create a unicode string in python with the string eg: This is a string?

Hey, @Roshni, It is very simple to execute, ...READ MORE

Jun 23, 2020 in Python by Gitika
• 65,910 points
525 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,880 points
2,636 views
+1 vote
1 answer

Python error "pygame.error: Couldn't open pygame.png"

icon = pygame.image.load('spaceship.png') pygame.error: Couldn't open spaceship.png I am ...READ MORE

Apr 9, 2020 in Python by Ali
10,088 views