Most voted questions in Python

0 votes
1 answer

How can I convert a list of dictionaries from a CSV into a JSON object in Python?

You could try using the AST module. ...READ MORE

Apr 17, 2018 in Python by anonymous
3,242 views
0 votes
1 answer

How can I write nested dictionaries to a csv file?

You can use the pandas library to ...READ MORE

Apr 17, 2018 in Python by anonymous
927 views
0 votes
1 answer

Looping over dictionary values

You can loop over the dictionary and ...READ MORE

Apr 17, 2018 in Python by Nietzsche's daemon
• 4,260 points
492 views
0 votes
1 answer

Unique identification for data items in Python

Try the UUID module of Python. For example, ...READ MORE

Apr 17, 2018 in Python by Nietzsche's daemon
• 4,260 points
990 views
0 votes
2 answers

Unable to use print statement in python3

print will work when you use print("Your ...READ MORE

Feb 14, 2019 in Python by Shashank
• 1,370 points
883 views
0 votes
1 answer

How can I find out the index of an element from row and column in Python?

You probably want to use np.ravel_multi_index: [code] import numpy ...READ MORE

Apr 16, 2018 in Python by charlie_brown
• 7,720 points
2,044 views
0 votes
1 answer

How can I compare the content of two files in Python?

Assuming that your file unique.txt just contains ...READ MORE

Apr 16, 2018 in Python by charlie_brown
• 7,720 points
2,374 views
–1 vote
1 answer

How to get the current URL within a Django template?

Hello @kartik, You can fetch the URL in ...READ MORE

Aug 6, 2020 in Python by Niroj
• 82,880 points
8,019 views
–1 vote
0 answers

Python Challenge : Writing a file

Write a sign up program for a ...READ MORE

Sep 4, 2019 in Python by Waseem
• 4,540 points
403 views
–1 vote
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,210 points
32,558 views
–1 vote
1 answer

Python error saying "NameError: name 'email' is not defined"

you need to define the variable email READ MORE

Nov 29, 2019 in Python by Casper
• 160 points
6,375 views
–1 vote
1 answer

Playing with Lists in Python

Hey @Fez, you can try something like ...READ MORE

May 28, 2019 in Python by Thanisha
1,017 views
–1 vote
1 answer

Python convert excel file to csv

Here you go: import glob path_to_excel_files = glob.glob('path/to/excel/files/*.xlsx') for ...READ MORE

Feb 8, 2019 in Python by Omkar
• 69,210 points
973 views
–1 vote
1 answer

nmap.nmap.PortScannerError: 'nmap program was not found in path

python-nmap module used in python happens to use nmap binary ...READ MORE

Jan 30, 2019 in Python by Omkar
• 69,210 points
14,659 views
–1 vote
1 answer

How to calculate difference in timestamp columns?

First, write the data in a csv file. Then ...READ MORE

Jan 19, 2019 in Python by Omkar
• 69,210 points
622 views
–1 vote
1 answer

Need help printing a Pandas Dataframe without the index in Python

Hi, the answer is a very simple ...READ MORE

Jan 16, 2019 in Python by Nymeria
• 3,560 points
2,803 views
–1 vote
1 answer

Python pandas axis error

When you are applying sum() you don't ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,210 points
1,861 views
–1 vote
1 answer

Python change directory error

The syntax of the command you are ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,210 points
1,413 views
–1 vote
1 answer

Pyspark rdd How to get partition number in output ?

The glom function is what you are looking for: glom(self): ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,210 points
2,312 views
–1 vote
1 answer

Python program that calculates and prints value according to formula

Try this: import math c = 50 h = 30 value ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,210 points
4,668 views
–1 vote
2 answers

How to filter out any digit that contains odd number in a range of number in Python?

n = list(range(10)) b = list(filter(lambda i:i%2!=0,n)) print(b) READ MORE

Oct 1, 2019 in Python by Nomizo_Coders
1,791 views
–1 vote
2 answers

How to find the size of a string in Python?

following way to find length of string  x ...READ MORE

Mar 29, 2019 in Python by rajesh
• 1,270 points
1,634 views