Trending questions in Python

+1 vote
10 answers

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

Just for the record: >>> int('55063.000000') Traceback (most recent ...READ MORE

Aug 17, 2020 in Python by pakainfo
• 200 points
210,182 views
+1 vote
4 answers

In Python, what is difference between Array and List?

Lists and arrays are used in Python ...READ MORE

Mar 15, 2019 in Python by Taj
• 1,080 points

edited Mar 18, 2019 by Omkar 107,760 views
+2 votes
12 answers

How to print array/ list without brackets in python?

print(*names, sep = ', ') This is what ...READ MORE

Dec 10, 2018 in Python by Sudo
104,699 views
+1 vote
3 answers

How to change/update cell value in Python Pandas dataframe?

You can use the at() method to ...READ MORE

Apr 8, 2019 in Python by Kunal
96,493 views
+6 votes
8 answers

What exactly is the function of random.seed() in python?

The seed method is used to initialize the ...READ MORE

Oct 29, 2018 in Python by Rahul
98,769 views
0 votes
3 answers

Python error "IndentationError: expected an indented block"

IndentationError:  what is the mean READ MORE

Oct 14, 2020 in Python by anonymous
• 140 points
92,382 views
0 votes
3 answers

How to use not equal operator in python

We can use Python not equal operator ...READ MORE

Dec 9, 2020 in Python by Niroj
• 82,540 points
88,889 views
+2 votes
2 answers

UnicodeDecodeError: "utf-8" codec can't decode byte in position : invalid start byte

You have to use the encoding as latin1 ...READ MORE

Jul 23, 2019 in Python by Kunal
79,415 views
+2 votes
4 answers

Python: UnicodeDecodeError: "utf-8" codec can"t decode byte 0xa0 in position 10: invalid start byte

You have to use the encoding as latin1 ...READ MORE

Jul 11, 2019 in Python by Ritu
75,062 views
+1 vote
5 answers

Python error "ERROR: Could not find a version that satisfies the requirement PyQt4 (from versions: none)"

You cannot install PyQt directly from pip. ...READ MORE

Jul 22, 2019 in Python by Bob
62,031 views
+1 vote
3 answers

How can I use python to execute a curl command?

For sake of simplicity, maybe you should ...READ MORE

Oct 11, 2018 in Python by charlie_brown
• 7,780 points
60,622 views
0 votes
1 answer

How to find the index of a particular value in a dataframe?

First, use the dataframe to match the ...READ MORE

Apr 8, 2019 in Python by Esha
69,253 views
0 votes
2 answers

Python Pandas error: AttributeError: 'DataFrame' object has no attribute 'rows'

Try this: data=pd.read_csv('/your file name', delim_whitespace=Tru ...READ MORE

Dec 10, 2020 in Python by anonymous
• 82,540 points
55,739 views
0 votes
4 answers

How do I remove an element from a list by index in Python?

1886 Use del and specify the index of the element ...READ MORE

Dec 11, 2020 in Python by Gitika
• 65,850 points
48,310 views
0 votes
3 answers

Python Pandas: ValueError: DataFrame constructor not properly called!

The syntax is not right. The right ...READ MORE

Mar 28, 2019 in Python by Ritu
47,703 views
0 votes
3 answers

How to get the return value from a thread using python?

FWIW, the multiprocessing module has a nice interface for ...READ MORE

Dec 15, 2020 in Python by Roshni
• 10,400 points
49,523 views
+1 vote
3 answers

ModuleNotFoundError: No module named 'cv2'

Hi@akhtar, This error may occur if you didn't install ...READ MORE

Apr 9, 2020 in Python by MD
• 94,990 points
38,159 views
0 votes
3 answers

Python exit commands - why so many and when should each be used?

The functions* quit(), exit(), and sys.exit() function in the same way: ...READ MORE

Dec 13, 2020 in Python by Gitika
• 65,850 points
50,063 views
0 votes
3 answers

TypeError: unsupported operand type(s) for -: 'str' and 'str'

& is "bitwise and" operand in Python, you ...READ MORE

Dec 11, 2020 in Python by Rajiv
• 8,880 points
41,352 views
0 votes
5 answers

How to read Pandas csv file with no header?

Use this logic, if header is present ...READ MORE

Mar 14, 2020 in Python by Shahabuddin
• 160 points
41,318 views
+1 vote
4 answers

How to install tkinter in pycharm?

Ya, this is a problem with installing ...READ MORE

Apr 3, 2019 in Python by Jishan
37,087 views
0 votes
4 answers

How to print objects of class using print function in Python?

>>> class Test: ... ...READ MORE

Dec 15, 2020 in Python by Roshni
• 10,400 points
39,195 views
0 votes
3 answers

how to exit a python script in an if statement

In Python, the break statement provides you with the opportunity ...READ MORE

Dec 13, 2020 in Python by Roshni
• 10,400 points
39,216 views
+1 vote
4 answers

Python: convert txt file to csv format with rows and columns

Python will read data from a text ...READ MORE

Dec 13, 2020 in Python by Gitika
• 65,850 points
31,346 views
0 votes
5 answers

How can I use grep in Python?

The first part starts with grep , followed by ...READ MORE

Dec 13, 2020 in Python by Gitika
• 65,850 points
34,652 views
+1 vote
4 answers

How do i resolve the "unexpected indent" error in python?

As the error message indicates, you have ...READ MORE

Nov 26, 2019 in Python by bennetcole
• 160 points
1 flag 28,255 views
+1 vote
7 answers

What do you mean by python scripting? What is a script and a module in python?

A module is a file containing a ...READ MORE

Jun 17, 2019 in Python by Zain Abbas
36,755 views
0 votes
3 answers

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Nadeem\AppData\Local\Temp\

You have an out of date version ...READ MORE

Dec 15, 2020 in Python by Rajiv
• 8,880 points
20,222 views
0 votes
3 answers

AttributeError: 'numpy.ndarray' object has no attribute 'append'

for root, dirs, files in os.walk(directory): ...READ MORE

Dec 11, 2020 in Python by Rajiv
• 8,880 points
20,275 views
+2 votes
3 answers

ModuleNotFoundError: No module named 'Crypto'

The module you’ve installed is different. To install ...READ MORE

Aug 20, 2019 in Python by Raman
25,269 views
0 votes
4 answers

how to sort a list of numbers without using built-in functions like min, max or any other function?

I guess you are trying to do ...READ MORE

Dec 11, 2020 in Python by Rajiv
• 8,880 points
25,205 views
+1 vote
3 answers

Difference between append vs. extend list methods in Python

Python append() method adds an element to ...READ MORE

Aug 21, 2019 in Python by germyrinn
• 220 points
33,597 views
+1 vote
3 answers

(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

You are getting this error because you ...READ MORE

Dec 31, 2019 in Python by Kalgi
• 52,290 points
20,364 views
+1 vote
3 answers

How to print one pandas column without index?

There is a slight mistake in what ...READ MORE

Mar 28, 2019 in Python by Shri
26,287 views
0 votes
3 answers

Pandas - FillNa with another column

You could do df.Cat1 = np.where(df.Cat1.isnull(), df.Cat2, df.Cat1 ...READ MORE

Dec 15, 2020 in Python by Roshni
• 10,400 points
21,325 views
0 votes
5 answers

what is the difference between append and insert in python lists?

There is a simple difference between append ...READ MORE

Jun 22, 2019 in Python by Harshdeep Khatke
22,883 views
+1 vote
3 answers

How do I share global variables across modules? - python

The canonical way to share information across ...READ MORE

Dec 15, 2020 in Python by Roshni
• 10,400 points
19,863 views
+2 votes
4 answers

How can I replace values with 'none' in a dataframe using pandas

Actually in later versions of pandas this ...READ MORE

Aug 13, 2018 in Python by bug_seeker
• 15,550 points
29,913 views
0 votes
3 answers

How to replace negative numbers in Pandas Data Frame by zero?

 If all your columns are numeric, you ...READ MORE

Dec 16, 2020 in Python by Rajiv
• 8,880 points
19,894 views
0 votes
3 answers
0 votes
3 answers

Python error "NameError: name 'sr' is not defined"

NameError: name 'xx' is not defined Python knows ...READ MORE

Mar 19, 2020 in Python by rahul
• 360 points
30,427 views
0 votes
3 answers

import NumPy as np ImportError: No module named NumPy

You need to install numpy using pip install ...READ MORE

Dec 16, 2020 in Python by Roshni
• 10,400 points
13,247 views
0 votes
3 answers

TypeError: Index(...) must be called with a collection of some kind, 'Email' was passed

It is not working because your code ...READ MORE

May 12, 2020 in Python by anonymous

edited May 13, 2020 by Gitika 23,448 views
0 votes
2 answers

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

R u getting the issue while running ...READ MORE

Nov 2, 2020 in Python by anonymous
6,485 views
+2 votes
2 answers

ImportError: numpy.core.multiarray failed to import

try this... run this code one by one.... pip ...READ MORE

Nov 4, 2020 in Python by Anand Vijay Rajsri

reshown Nov 4, 2020 by Sirajul 8,261 views
0 votes
1 answer

TypeError: cannot unpack non-iterable NoneType object

Hello, The “TypeError: cannot unpack non-iterable NoneType object” ...READ MORE

Oct 5, 2020 in Python by Lisa
6,637 views
0 votes
2 answers

In Python, How do I read 2 CSV files, compare column 1 from both, and then write to a new file where the Column 1s match?

Hi @Mike. First, read both the csv ...READ MORE

Jul 24, 2019 in Python by Omkar
• 69,130 points
16,283 views
0 votes
2 answers

TypeError: 'float' object cannot be interpreted as an integer

Hi@akhtar, The range function does not work with ...READ MORE

Jun 29, 2020 in Python by MD
• 94,990 points
6,171 views
0 votes
4 answers

Install Python3 on Mac

Prerequisites You will need a macOS computer with ...READ MORE

Dec 15, 2020 in Python by Roshni
• 10,400 points
11,680 views
0 votes
1 answer

KeyError: "['Place'] not found in axis"

Hi@akhtar, You need to provide the axis parameter ...READ MORE

Jun 24, 2020 in Python by MD
• 94,990 points
10,114 views