Trending questions in Python

+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,800 points
1,966 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,800 points
1,807 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,800 points
2,082 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,946 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,730 points
2,060 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,800 points
1,672 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,730 points
2,027 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,800 points
1,604 views
0 votes
1 answer

Run a function after keyboard interrupt in python

Below is the code to run a ...READ MORE

Jul 26, 2019 in Python by Shri
16,412 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
1,889 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,190 points
1,943 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
3,371 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
4,639 views
0 votes
1 answer

How to reimport an updated package while in Python Interpreter?

Hello, To import an updated package while in ...READ MORE

May 12, 2020 in Python by Niroj
• 82,800 points
3,791 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,909 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,800 points
1,809 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
1,640 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,936 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,730 points
1,724 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
1,847 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,800 points
2,365 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,912 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
1,750 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,800 points
3,995 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
1,271 views
0 votes
1 answer

python JSON only get keys in first level

You just need a simple .keys() >>> dct ...READ MORE

Jan 22, 2019 in Python by SDeb
• 13,300 points
24,248 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
2,507 views
0 votes
2 answers

Removing Title bar in Tkinter program

you can remove the title bar by ...READ MORE

Mar 19, 2019 in Python by anonymous
23,526 views
0 votes
1 answer

How to create one Pytest program?

Hi@akhtar, You need to create a file named test_*.py and ...READ MORE

Jun 24, 2020 in Python by MD
• 95,460 points
1,787 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,730 points
1,661 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,800 points
1,746 views
0 votes
1 answer

I have trained a model using machine learning algorithm in python , now i want to create a browser extension of that saved model , Is it possible ??

Hi@Shubham, It may possible. When you saved your ML ...READ MORE

Jun 13, 2020 in Python by MD
• 95,460 points
2,240 views
0 votes
1 answer

timedelta in years

Use the following piece of code: x1=datetime.timedelta(days=3000, seconds=0, ...READ MORE

Aug 8, 2019 in Python by Wajiha
• 1,960 points
15,593 views
0 votes
1 answer

How to delete items from a dictionary while iterating over it?

Hii Kartik, You could do it in two ...READ MORE

Apr 30, 2020 in Python by Niroj
• 82,800 points
4,087 views
0 votes
2 answers

Extracting data from a JSON file in Python

Here is what i found and was ...READ MORE

Nov 27, 2018 in Python by Rupali
31,298 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,730 points
1,729 views
0 votes
1 answer

Convert csv file to NumPy array

Hi @Lina, you can use this: numpy_array = ...READ MORE

May 24, 2019 in Python by Puneet
18,810 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
1,615 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,933 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,730 points
1,583 views
0 votes
0 answers

TypeError: descriptor 'strftime' requires a 'datetime.date' object but received a 'str'

def dt_to_str(date, fma='%Y-%m-%d'):     """     Converts a datetime object to ...READ MORE

Mar 4, 2020 in Python by anonymous
• 120 points

recategorized Mar 4, 2020 by Gitika 6,508 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,800 points
2,150 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,730 points
1,532 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,800 points
1,693 views
0 votes
1 answer

How to pretty-print a numpy.array without scientific notation and with given precision?

Hii @kartik, The numpy arrays have the method round(precision) which ...READ MORE

Apr 14, 2020 in Python by Niroj
• 82,800 points
4,674 views
0 votes
1 answer

How do I get the path and name of the file that is currently executing?

Hello @kartik, Since Python 3 is fairly mainstream, ...READ MORE

May 11, 2020 in Python by Niroj
• 82,800 points
3,493 views
0 votes
1 answer

I'm working on a Summer dataset for practice in Python. However I get the below error:

Hi@Pratap, I think to find duplicate values using ...READ MORE

Jun 15, 2020 in Python by MD
• 95,460 points
1,996 views
0 votes
0 answers

how to install kivy module in spyder?

Apr 20, 2020 in Python by amey
• 120 points
4,438 views
0 votes
1 answer

How to set Colorbar Range in matplotlib using Python

You could scale your data to the ...READ MORE

Nov 22, 2018 in Python by Nymeria
• 3,560 points
26,639 views
0 votes
1 answer

How to set colume as index in Pandas DataFrame?

Hi@akhtar, You can use set_index function in pandas. ...READ MORE

Jun 23, 2020 in Python by MD
• 95,460 points
1,635 views