Most viewed questions in Python

0 votes
1 answer

I have a code that I want to use alter values between two columns in my dataset

Hi @elvin. I read your script and ...READ MORE

Mar 17, 2019 in Python by Omkar
• 69,210 points
554 views
0 votes
1 answer

I am using a built-in function name as a method identifier and sometimes as an attribute in Python, is this bad?

Hi, good question. The thing is that ...READ MORE

Jan 23, 2019 in Python by Nymeria
• 3,560 points
554 views
0 votes
1 answer

Python Pandas Dataframe: How to remove blankspaces on the left side of the string?

You can do it as follows: idx = ...READ MORE

May 14, 2019 in Python by Kunal
553 views
0 votes
1 answer

Avoid killing children when parent process is killed

I would recommend against your design as ...READ MORE

Sep 14, 2018 in Python by Priyaj
• 58,090 points
553 views
0 votes
1 answer

pandas and Stata 13 files

You can check with the following: Update your ...READ MORE

Jul 4, 2019 in Python by SDeb
• 13,300 points
552 views
0 votes
1 answer

Retrieving all Cookies in Python

Here is an example through which you ...READ MORE

Apr 25, 2019 in Python by SDeb
• 13,300 points
552 views
0 votes
1 answer

Create a GUID/UUID in Python

The uuid module, in Python 2.5 and ...READ MORE

Nov 22, 2018 in Python by SDeb
• 13,300 points
552 views
0 votes
0 answers

Combined mean and standard deviation from a collection of NumPy arrays of different shapes

Consider that I have a numpy array ...READ MORE

Aug 2, 2022 in Python by krishna
• 2,820 points
551 views
0 votes
1 answer

How to list files/directories in python

You can use the os module to list the ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,210 points
551 views
0 votes
0 answers

print(lst[-2:-4]) is not possible why?

Mar 13, 2020 in Python by Anubhuti
• 120 points
550 views
0 votes
1 answer

What are some good web crawlers in Python?

Following are the libraries that can help ...READ MORE

Jul 22, 2019 in Python by Arvind
• 3,040 points
550 views
0 votes
0 answers

How can I make a snake game using python?

Is there a separate library just meant ...READ MORE

May 13, 2019 in Python by Waseem
• 4,540 points
550 views
0 votes
1 answer

How do I sort a dictionary by value?

It is not possible to sort a ...READ MORE

Jul 30, 2018 in Python by Priyaj
• 58,090 points
550 views
0 votes
0 answers

How do I access environment variables in Python?

May 26, 2022 in Python by Kichu
• 19,050 points
549 views
0 votes
0 answers

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

So I have recently installed Python Version ...READ MORE

Apr 18, 2022 in Python by Edureka
• 13,620 points
549 views
0 votes
1 answer

Animated sprite from few images

You could try modifying your sprite so ...READ MORE

Jul 11, 2019 in Python by SDeb
• 13,300 points
549 views
0 votes
1 answer

How to add new keys to an already created python dictionary?

my_dict = {'name':'Jack', 'age': 26} my_dict['address'] = 'Downtown' ...READ MORE

Jun 26, 2019 in Python by Neel
• 3,020 points
549 views
0 votes
1 answer

'f' strings in Python

They are also known as Literal String ...READ MORE

Jun 25, 2019 in Python by Fata
• 1,050 points
549 views
0 votes
1 answer

How does slice notation in Python work?

The Python tutorial talks about it (scroll down a ...READ MORE

Oct 31, 2018 in Python by Priyaj
• 58,090 points
549 views
0 votes
1 answer

Python 'If not' syntax

Yes, if bar is not None is ...READ MORE

Aug 1, 2018 in Python by Priyaj
• 58,090 points
549 views
0 votes
0 answers

matrix multiplication of arrays in python

I am having trouble finding a solution ...READ MORE

Aug 2, 2022 in Python by krishna
• 2,820 points
547 views
0 votes
1 answer

How do I check if a string is a number (float)?

I'm not sure that anything much could ...READ MORE

Dec 2, 2020 in Python by Gitika
• 65,910 points
547 views
0 votes
1 answer

What is the patterns package in python used for?

Pattern is a web mining tool in ...READ MORE

Jul 31, 2019 in Python by Mohammad
• 3,230 points
547 views
0 votes
0 answers

what is the scope of the variable in a conditional statement?

what are global and local variables in ...READ MORE

Apr 17, 2019 in Python by Waseem
• 4,540 points
547 views
0 votes
1 answer

how to get mongoengine object id in flask program

Check out the documentation, Document.objects is a QuerySet object. You seem to be ...READ MORE

Oct 10, 2018 in Python by Priyaj
• 58,090 points
547 views
0 votes
1 answer

Count the frequency of all list items

You can do this using a dictionary: dict((i, ...READ MORE

May 3, 2018 in Python by Nietzsche's daemon
• 4,260 points
547 views
0 votes
1 answer

return [x + y for x, y in zip(a, b)]

Hello @Ahmad, Could you please explain your workaround ...READ MORE

Nov 3, 2020 in Python by Gitika
• 65,910 points
546 views
0 votes
1 answer

Using Python what kind of applications can be built?

http://en.wikipedia.org/wiki/List_of_Python_software  follow the link and You will see ...READ MORE

Nov 14, 2018 in Python by Theodor
• 740 points
546 views
0 votes
1 answer

How do I sort a list of dictionaries by a value of the dictionary?

Hello @kartik, import operator To sort the list of ...READ MORE

Apr 23, 2020 in Python by Niroj
• 82,880 points
545 views
0 votes
1 answer

Python Significant projects

Hi @Zaid, Have a look at this ...READ MORE

Jun 7, 2019 in Python by Ishaan
545 views
0 votes
1 answer

Python: Get current system/local time

You can use the datetime module for this. ...READ MORE

May 8, 2019 in Python by Suman
545 views
0 votes
1 answer

How to set a random seed for prn generation?

The main python module that is run ...READ MORE

Feb 4, 2019 in Python by charlie_brown
• 7,720 points
545 views
0 votes
1 answer

How Can I log a Python error with debug information?

Hii, Using exc_info options may be better, to allow you ...READ MORE

May 27, 2020 in Python by Niroj
• 82,880 points
544 views
0 votes
1 answer

example of mypy with static typing

Have a look at this example: import sys import ...READ MORE

Jun 7, 2019 in Python by Althier
544 views
0 votes
1 answer

nltk NgramModel error

This is an open issue because of ...READ MORE

May 15, 2019 in Python by SDeb
• 13,300 points
544 views
0 votes
1 answer

Change date and time format in Python.

Try the following code: date=time.split(‘ ’) time=dat ...READ MORE

May 8, 2019 in Python by Sagar
544 views
0 votes
1 answer

Conflicting dependencies of pypyodbc and blpapi

I figured out that pypyodbc only works ...READ MORE

Oct 9, 2018 in Python by Priyaj
• 58,090 points
544 views
0 votes
1 answer

Creating a matrix in Python

You can create arrays of any number ...READ MORE

Jun 19, 2018 in Python by Hamartia's Mask
• 1,580 points
544 views
0 votes
0 answers

How can I change the loss function when the shape of my data changes?

Since my data is too large, I ...READ MORE

Mar 27, 2020 in Python by Anan
• 180 points
543 views
0 votes
0 answers

Is there any console in python that is online and pluggable?

Is there some sort of online live ...READ MORE

Aug 13, 2019 in Python by Arvind
• 3,040 points
543 views
0 votes
1 answer

Is it possible to create a dictionary with multiple keys for a single value?

One thing that you can do here ...READ MORE

Jul 24, 2019 in Python by Arvind
• 3,040 points
543 views
0 votes
0 answers

How do you parse a string in python?

After splitting the string, how does parsing ...READ MORE

Jul 8, 2019 in Python by Waseem
• 4,540 points
543 views
0 votes
1 answer

End tkinter program - python

You can use the destroy() to close ...READ MORE

Aug 9, 2019 in Python by Barbara
542 views
0 votes
1 answer

Obtaining stack frame

inspect.stack() will get you the current stack ...READ MORE

May 3, 2019 in Python by SDeb
• 13,300 points
541 views
0 votes
1 answer

splitting and concatenating a string

You can try the following code in ...READ MORE

Apr 17, 2019 in Python by SDeb
• 13,300 points
541 views
+1 vote
1 answer

Zip lists in Python

zip takes a bunch of lists likes a: ...READ MORE

Aug 22, 2018 in Python by Priyaj
• 58,090 points
541 views
0 votes
1 answer

Monkey Patching

Dynamically modifying a class or module at ...READ MORE

Jul 20, 2018 in Python by Priyaj
• 58,090 points
541 views
0 votes
1 answer

HI Mr / Mrs I have problem with my jupiter notebook when i try to learn Your video about Machine Learning. Can You help me please ?

Hi@Herlambang, I think you have a 32-bit system. ...READ MORE

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

Existing key in Python

The intended way to check for the ...READ MORE

Oct 3, 2018 in Python by SDeb
• 13,300 points
540 views
0 votes
1 answer

How do I know what's going to be deleted?

An easy system would be to add ...READ MORE

Aug 28, 2018 in Python by anonymous
540 views