Trending questions in Python

0 votes
1 answer

How to convert multiple columns to string in pandas dataframe?

Hi, To convert multiple columns to string, include a list of ...READ MORE

Jul 18 in Python by Taj
• 1,040 points
32 views
0 votes
0 answers
0 votes
1 answer

Is there a list of timezones in python?

import pytz list(pytz.common_timezones) READ MORE

Aug 2 in Python by Mohammad
• 2,820 points
10 views
0 votes
1 answer

What is the purpose of hash function in python?

The hash() method returns the hash value of an object if it ...READ MORE

Aug 2 in Python by Mohammad
• 2,820 points
26 views
0 votes
1 answer

How to iterate over row in a Dataframe in Pandas?

Hi, You can use df.iterrows(), it yields both ...READ MORE

Jul 18 in Python by Taj
• 1,040 points
18 views
0 votes
0 answers

how do you install python modules in mac os?

Is it different from installing modules in ...READ MORE

Jul 19 in Python by Waseem
• 4,160 points
14 views
0 votes
1 answer

Is it possible to access .NET code written in C# from Python?

If you want to mainly base your ...READ MORE

Jul 18 in Python by Arvind
• 2,520 points
19 views
0 votes
0 answers

how does sorted function works in python?

How are the arguments passed in the ...READ MORE

Jul 19 in Python by Waseem
• 4,160 points
12 views
0 votes
1 answer

How to perform string operations on every element of a list of strings?

This can be done using list comprehension ...READ MORE

Jul 18 in Python by Arvind
• 2,520 points
13 views
0 votes
1 answer

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

Look for the whitespaces which are not ...READ MORE

Aug 2 in Python by Mohammad
• 2,820 points
12 views
0 votes
1 answer

How do you convert a dictionary to a defaultdict?

from collections import defaultdict a = {1: 2, ...READ MORE

Aug 2 in Python by Mohammad
• 2,820 points
25 views
0 votes
1 answer

Sort (hex) colors to match rainbow

Here's a function that, given a color ...READ MORE

Jul 17 in Python by SDeb
• 13,160 points
30 views
0 votes
0 answers

Why is selenium css and xpath selector not working?

selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: An invalid or ...READ MORE

Jul 18 in Python by Waseem
• 4,160 points
21 views
0 votes
0 answers

How to perform string operations on every element of list ?

I have a list of words in ...READ MORE

Jul 18 in Python by Neel
• 2,450 points
14 views
0 votes
1 answer

SyntaxError: Missing parentheses in call to "print".

The statement print "hello python" does not work in ...READ MORE

Jul 16 in Python by Umar
67 views
0 votes
1 answer

What does the operator "/=" do in python?

x = 20 res = x /= 5 print(res) The ...READ MORE

Aug 2 in Python by Mohammad
• 2,820 points
11 views
0 votes
1 answer

Connect to two databases

If you don't specify the database in ...READ MORE

Jul 17 in Python by SDeb
• 13,160 points
16 views
0 votes
0 answers

How to sort two different lists with same common value?

list1 = [ ["name1", 100], ["name2", 33], ...READ MORE

Jul 18 in Python by Waseem
• 4,160 points
11 views
0 votes
1 answer

how to check whether a string starts with a particular word?

For this, you can use the built-in ...READ MORE

Jul 17 in Python by Neel
• 2,450 points
17 views
0 votes
1 answer

Is it possible to find the source code of built-in functions of Python?

Since Python is open source you can ...READ MORE

Jul 17 in Python by Neel
• 2,450 points
14 views
0 votes
1 answer

KDE in seaborn distplot()

Kernel Density Estimation (KDE) is a way ...READ MORE

Jul 16 in Python by Kunal
48 views
0 votes
0 answers

How to install tkinter on windows?

Does it work like the other libraries ...READ MORE

Jul 17 in Python by Waseem
• 4,160 points
42 views
0 votes
1 answer

What is abs in Python?

The abs() method returns the absolute value ...READ MORE

Jul 16 in Python by Arvind
• 2,520 points
13 views
0 votes
1 answer

How to find the type of variable in Python?

i=277 type(i) # int i = 2.56j type(i) # complex i ...READ MORE

Jul 16 in Python by Arvind
• 2,520 points
13 views
0 votes
1 answer

Generators with plots

Yes, you can. I tried doing it ...READ MORE

Jul 16 in Python by Wajiha
• 1,840 points
16 views
0 votes
1 answer

What are raw string literals?

A raw string literal opens with a sequence of ...READ MORE

Jul 31 in Python by Mohammad
• 2,820 points
13 views
0 votes
0 answers

How to get the ASCII values of a character in python?

Is there a function for this task ...READ MORE

Jul 17 in Python by Waseem
• 4,160 points
14 views
0 votes
1 answer

How to eliminate out outliers in a dataframe?

There are various ways we can replace ...READ MORE

Jul 16 in Python by Dinesh
17 views
0 votes
1 answer

What data format for large files in R?

Zipping won't help you, as you'll have ...READ MORE

Jul 16 in Python by SDeb
• 13,160 points
16 views
0 votes
1 answer

Pyglet Image Rendering

I will assume you have something along ...READ MORE

Jul 16 in Python by SDeb
• 13,160 points
15 views
0 votes
1 answer

Python Slicing operation

The difference in the output which you ...READ MORE

Jul 16 in Python by Kiran
13 views
0 votes
2 answers

Write a for loop that prints all elements of a list and their position in the list. a = [4,7,3,2,5,9]

a = [4,7,3,2,5,9] b = enumerate(a) for i in ...READ MORE

Jul 15 in Python by Kei Tee

edited Jul 22 by Kalgi 107 views
0 votes
1 answer

Python: Splitting numPY 2 D Array

For splitting the 2d array,you can use ...READ MORE

Jul 15 in Python by Siri
51 views
0 votes
1 answer

Difference between function and generator?

Normal Functions vs Generator Functions: Generators in Python ...READ MORE

Jul 15 in Python by Wajiha
• 1,840 points
30 views
0 votes
1 answer

UnicodeDecodeError: "utf-8" codec can"t decode byte 0xeb in position 8: unexpected end of data

To read this dataset use encoding as ...READ MORE

Jul 15 in Python by Rishi
30 views
0 votes
1 answer

How to access specific columns from a csv file?

Instead of using csv module in Python, ...READ MORE

Jul 15 in Python by Neel
• 2,450 points
19 views
0 votes
1 answer

Is it possible to print a string and a variable in a single print statement in Python?

This can be done using simple string ...READ MORE

Jul 15 in Python by Neel
• 2,450 points
19 views
0 votes
1 answer

Undefined Behaviour in Python

Python evaluates expressions from left to right. ...READ MORE

Jul 15 in Python by SDeb
• 13,160 points
20 views
0 votes
0 answers

How does pillow work in opening and closing images in python?

Is there a separate library that we ...READ MORE

Jul 16 in Python by Waseem
• 4,160 points
16 views
0 votes
1 answer

Generator Expressions vs. List Comprehension

Generator expression resemble list comprehensions. List comprehensions ...READ MORE

Jul 15 in Python by Wajiha
• 1,840 points
18 views
0 votes
1 answer

How to create LIST from CSV file in Python?

You can use the pandas library for this which ...READ MORE

Jul 15 in Python by Karan
18 views
0 votes
1 answer

char list from 0 to f

The simplest way would be a list ...READ MORE

Jul 15 in Python by SDeb
• 13,160 points
12 views
0 votes
1 answer

DataFrame slicing in Python

You can use criteria based subset for ...READ MORE

Jul 15 in Python by Sakra
15 views
0 votes
1 answer

Construct an array with Nan elements

Create a numpy array with nan value ...READ MORE

Jul 15 in Python by Yogi
12 views
0 votes
2 answers

How to check whether a string contains alphabets or number in Python?

By using isAlpha () to check whether ...READ MORE

Jul 13 in Python by Sheik janibasha
48 views
0 votes
0 answers

i am normalizing the data set iris in python and get the error ::TypeError: 'numpy.float64' object is not callable

for i in cnames:     print(i)     df_csv[i] = (df_csv[i] - ...READ MORE

Jul 14 in Python by anonymous
55 views
0 votes
1 answer

How to draw a tic tac toe board in python?

Following is a code to draw a ...READ MORE

Jul 31 in Python by Mohammad
• 2,820 points
34 views
0 votes
1 answer

Python: Megre multiple dataframes into single data frame

You can merge the data frame using ...READ MORE

Jul 14 in Python by Sharan
26 views
0 votes
1 answer

How to resolve the error while importing cv2 from openCV in python?

I would recommend you go with anaconda ...READ MORE

Jul 31 in Python by Mohammad
• 2,820 points
23 views
0 votes
1 answer

How to compare expected and predicted values?

The predict() function returns a plain numpy ...READ MORE

Jul 13 in Python by Tina
14 views