Trending questions in Python

0 votes
1 answer

How to find path of Python interpreter?

In Python, the sys module has System-specific ...READ MORE

Jul 26 in Python by Arvind
• 2,760 points
10 views
0 votes
1 answer

How to use Python notebooks using Python 3?

This can be done using following steps ...READ MORE

Jul 26 in Python by Arvind
• 2,760 points
9 views
0 votes
1 answer

Read Nested Json as DataFrame

Here is the code for it. da=[ {"age":34, "id":1, "name":"Tony", "salary":1400, "dept_no":[10,20], "Cntct":{"Phone":[1234567890,9876543210], "state":"NY", ...READ MORE

Jul 25 in Python by Jimmy
44 views
0 votes
1 answer

sklearn.cross_validation import train_test_split not working

cross_validation is not a part of sklearn ...READ MORE

Jul 25 in Python by Sharan
25 views
+1 vote
1 answer

How do I share global variables across modules? - python

The best way to share global variables ...READ MORE

Jul 24 in Python by Faiza
14 views
0 votes
1 answer

How do you make a higher order function in Python?

You have two choices to create higher-order ...READ MORE

Jul 25 in Python by Yesha
20 views
0 votes
1 answer

Is there an equivalent of C’s (?:) ternary operator in python?

Yes, there is. The syntax is as ...READ MORE

Jul 25 in Python by Alia
18 views
0 votes
1 answer

Why does changing one list, change another - Python

Hey @Aleesha, here when you write x=y, ...READ MORE

Jul 25 in Python by Kanika
20 views
0 votes
1 answer

How to print like printf in Python3?

To print like printf in Python you ...READ MORE

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

Copy object in Python

In general, copy.copy() or copy.deepcopy() works perfectly ...READ MORE

Jul 25 in Python by Tanishq
16 views
0 votes
1 answer

Callable objects approach vs nested scope approach to create higher order functions - python

Using callable objects has a disadvantage over ...READ MORE

Jul 25 in Python by Vivan
15 views
0 votes
1 answer

Python error "UnboundLocalError: local variable 'x' referenced before assignment"

You get this error because when you ...READ MORE

Jul 24 in Python by Greg
49 views
0 votes
1 answer

What does super() function do in python?

Super function calls the parent class method ...READ MORE

Aug 2 in Python by Mohammad
• 3,060 points
16 views
0 votes
1 answer
0 votes
1 answer

Writing output to new file using xml.etree.ElementTree in python

To write results to a new file, ...READ MORE

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

Compress and decompress string in Python

You can use the zlib module available in ...READ MORE

Jul 23 in Python by Bhagavath
80 views
0 votes
0 answers

Is game development good in python?

What are the tools and libraries for ...READ MORE

Jul 25 in Python by Waseem
• 4,270 points
13 views
0 votes
0 answers

How do you create a new class instance using class method in python?

What is the function of super() in ...READ MORE

Jul 25 in Python by Waseem
• 4,270 points
12 views
0 votes
1 answer

Local and Global parameters rules - python

In python, variables that are only referenced ...READ MORE

Jul 24 in Python by Alia
18 views
0 votes
1 answer

What are data structures in python?

Data structures in python are basically the ...READ MORE

Aug 2 in Python by Mohammad
• 3,060 points
19 views
0 votes
1 answer

How to eliminate out outliers in a dataframe?

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

Jul 24 in Python by Shri
21 views
0 votes
1 answer

Why do lambdas defined in a loop with different values all return the same result?

Here x is not local to the ...READ MORE

Jul 24 in Python by Haseeb
15 views
0 votes
1 answer

what is webserver in python?

The Apache HTTP Server has been the most commonly ...READ MORE

Aug 2 in Python by Mohammad
• 3,060 points
15 views
0 votes
1 answer

Convert list into dict in Python

Try using the below-mentioned code, it should ...READ MORE

Jul 24 in Python by Banu
13 views
0 votes
1 answer

openssl_seal() in Python

I think it should be relatively straightforward ...READ MORE

Jul 24 in Python by SDeb
• 13,160 points
24 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 in Python by Arvind
• 2,760 points
22 views
0 votes
1 answer

How to manipulate a numpy?

You can use the below code slice ...READ MORE

Jul 24 in Python by Hari
14 views
0 votes
1 answer

Force Python Scrapy not to encode URL

When creating a Request object scrapy applies some url ...READ MORE

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

What is the use of '==' operator in dictionary in Python?

Yes you can use '==' operator to ...READ MORE

Jul 24 in Python by Arvind
• 2,760 points
14 views
0 votes
1 answer

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 in Python by Kunal
50 views
0 votes
1 answer

Python error "'Series' object is not callable "

Try this: df['ln_returns'] = np.log(df['Close_mid']/df['Close_mid']) df['Close_mid'](1)) doesn't seem to ...READ MORE

Jul 22 in Python by Greg
77 views
0 votes
1 answer

How to print a string with curly braces in Python?

You can use something like this - mystring ...READ MORE

Jul 23 in Python by Neel
• 2,730 points
27 views
0 votes
0 answers

pass optional or keyword parameters from one function to another in python?

How can I pass optional or keyword ...READ MORE

Jul 24 in Python by Hari
18 views
0 votes
1 answer

How to add elements to a list in Python?

To initialize an empty list do this: new_list ...READ MORE

Jul 23 in Python by Neel
• 2,730 points
20 views
0 votes
1 answer

Can I blindly jump into using docker in production?

Hey Jasmine If the question was can I ...READ MORE

Jul 23 in Python by Alia
16 views
0 votes
1 answer

Create vars based on number of elements on the list

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

Jul 23 in Python by Haseeb
16 views
0 votes
1 answer

How do you select a python interpreter in Pycharm?

Follow the following steps: Open the settings Open Project ...READ MORE

Aug 2 in Python by Mohammad
• 3,060 points
41 views
0 votes
1 answer

Difference between ElementTree and Minidom

Python allows parsing these XML documents using ...READ MORE

Jul 22 in Python by Wajiha
• 1,840 points
60 views
0 votes
0 answers

How do you install spyder on anaconda?

Is there a way to work with ...READ MORE

Jul 24 in Python by Waseem
• 4,270 points
20 views
0 votes
1 answer

Convert string to unicode in Python

Suppose you have a string in ASCII form ...READ MORE

Jul 23 in Python by Gani
20 views
0 votes
0 answers

How do you install python 3.6 in linux?

I am having trouble choosing interpreter as ...READ MORE

Jul 24 in Python by Waseem
• 4,270 points
18 views
0 votes
1 answer

input() vs sys.stdin.read()

If you're on Windows, you'll notice that ...READ MORE

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

Edit a function in Python IDLE

No, if you have readline support enabled, ...READ MORE

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

'NodeList' object has no attribute 'firstChild'

Use the following piece of code: from xml.dom ...READ MORE

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

What are the python libraries that can be used to perform web scraping in python?

for web scraping in python we can ...READ MORE

Aug 2 in Python by Mohammad
• 3,060 points
17 views
0 votes
1 answer

PyCharm type hinting weirdness

This looks like a bug in PyCharm. ...READ MORE

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

Plot a pie-chart in Python in Matplotlib

Not sure which dataset you are using. ...READ MORE

Jul 22 in Python by Shri
30 views
0 votes
1 answer

Need help to open excel file and read in Python

You can use pandas module to do ...READ MORE

Jul 22 in Python by Tina
22 views
0 votes
1 answer

Install python using Ansible

Try something like: - hosts: all remote_user: ...READ MORE

Jul 22 in Python by Travis
18 views