Trending questions in Python

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
18,418 views
+1 vote
1 answer

How do I create a slug in Django?

Hello @kartik, You will need to use the ...READ MORE

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

Error:PermissionError with pip3

Hello @kartik, Just install them using --user option ...READ MORE

Jul 2, 2020 in Python by Niroj
• 82,840 points
1,017 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,460 points
1,090 views
0 votes
1 answer

Create a SQL table from a Pandas DataFrame.

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

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

How can I enable project_id parameter of DJango to be optional?

Hello @kartik, There are several approaches. One is to ...READ MORE

Jul 3, 2020 in Python by Niroj
• 82,840 points
914 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,898 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,770 points
1,295 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,840 points
3,267 views
0 votes
1 answer

I want to install checker package using pip for my code because it shows no reference in my webapp code.

Hi@Rahul, You are trying to use configparser module. ...READ MORE

Jul 7, 2020 in Python by MD
• 95,460 points
612 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,840 points
1,092 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,840 points
1,688 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
1,159 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,602 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,840 points
876 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,747 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,460 points
1,147 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,460 points
3,829 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,460 points
1,157 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,460 points
989 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,840 points
1,123 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,460 points
965 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,770 points
931 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,840 points
1,536 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,770 points
1,052 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
1,016 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,770 points
866 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,460 points
1,017 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,460 points
1,237 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,680 points
2,529 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
736 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,460 points
1,030 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,840 points
891 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,840 points
1,002 views
+1 vote
2 answers

Python convert XLS and XLSX file to csv

XLSX tables are usually created in MS ...READ MORE

Aug 30, 2019 in Python by Mian Tanzeel
18,136 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,460 points
878 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,770 points
800 views
0 votes
1 answer

Error:pip install mysql-python fails with EnvironmentError: mysql_config not found

Hello @kartik, It seems mysql_config is missing on ...READ MORE

May 5, 2020 in Python by Niroj
• 82,840 points
2,983 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,460 points
770 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
788 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,840 points
803 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
1,065 views
0 votes
0 answers

how to install kivy module in spyder?

Apr 20, 2020 in Python by amey
• 120 points
3,624 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,770 points
802 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,770 points
669 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,460 points
1,459 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,460 points
722 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,770 points
686 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,840 points
1,268 views