Latest questions in Python

0 votes
1 answer

How to add to the python path in Windows?

You know what has worked for me ...READ MORE

Jul 25, 2018 in Python by Frankie
• 9,830 points
836 views
0 votes
1 answer

Python - convert string to list

states.split() will return ['Alaska', 'Alabama', 'Arkansas', 'American', 'Samoa', ...READ MORE

Jul 25, 2018 in Python by Frankie
• 9,830 points
488 views
0 votes
1 answer

How to get the current time in Python

>>> import datetime >>> datetime.datetime.now() datetime(2018, 25, ...READ MORE

Jul 25, 2018 in Python by Frankie
• 9,830 points
542 views
+1 vote
2 answers

What is the difference between classes and labels in machine learning?

Classes and Labels both are almost same things ...READ MORE

Apr 3, 2019 in Python by SA
• 1,090 points
7,079 views
+1 vote
1 answer

What is the correct order to learn concepts in Python for machine learning?

Machine Learning is a vast domain. It ...READ MORE

Jul 25, 2018 in Python by Abhi
• 3,720 points
807 views
0 votes
1 answer

Deleting a list element by index

Use the del() function del a[2] Or you can ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
513 views
0 votes
1 answer

Appending data to a file [closed]

with open("test.txt", "a") as myfile: ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
392 views
+1 vote
1 answer

Appending data to a file [closed]

To append a file without overwriting, open ...READ MORE

Aug 7, 2018 in Python by Omkar
• 69,230 points

edited Aug 7, 2018 by Omkar 431 views
+1 vote
2 answers

Appending data to a file

First open the file that you want ...READ MORE

Jul 23, 2018 in Python by Omkar
• 69,230 points
739 views
0 votes
1 answer

Connect to a MySQL DB in python?

db = MySQLdb.connect(host="localhost", # ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
567 views
0 votes
1 answer

Accessing Environment variables

import os print(os.environ['HOME']) READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
425 views
0 votes
1 answer

Random selections from list

Use random.choice() foo = ['a', 'b', 'c', 'd', ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
394 views
0 votes
1 answer

init.py file

It is used to denote directories on ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
398 views
0 votes
1 answer

__all__ in python

That is the list of public objects ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
710 views
0 votes
1 answer

Python Null Object

Use the 'None' keyword to denote the ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
689 views
0 votes
2 answers

Find the largest value in a dictionary

Use below running code which is simple ...READ MORE

Nov 25, 2021 in Python by Suhas
984 views
0 votes
3 answers

How to get the current time in Python

FOLLOWING WAY TO FIND CURRENT TIME IN ...READ MORE

Apr 8, 2019 in Python by rajesh
• 1,270 points
1,749 views
0 votes
1 answer

Python - convert string to list

try states.split() this would help. READ MORE

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

Best way to create a simple python web service

web.py is probably the simplest web framework ...READ MORE

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

What is the output of and explanation?

It will print concatenated lists. Output would ...READ MORE

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

*args and **kwargs in python

In cases when we don’t know how ...READ MORE

Jul 20, 2018 in Python by Priyaj
• 58,090 points
649 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
561 views
0 votes
1 answer

Whenever you exit Python, is all memory de-allocated?

The answer here is no. The modules ...READ MORE

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

What are the key features of Python?

If it makes for an introductory language ...READ MORE

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

Mean and average in numpy

np.average() can be used to calculate weighted ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
587 views
0 votes
1 answer

Printing a large numpy array

numpy.set_printoptions(threshold='nan') READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
1,561 views
0 votes
2 answers

What are the types of dictionary in python?

There are 4 types of dictionary Empty Integer Mixed Dictionary with ...READ MORE

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

What is the flow control for “continue” in python?

This is the way "continue" statement works! You ...READ MORE

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

Combining numpy arrays

There is concatenation function for numpy arrays ...READ MORE

Jul 3, 2018 in Python by Hamartia's Mask
• 1,580 points
944 views
0 votes
1 answer

Numpy data in csv

Use this -  numpy.savetxt("data.csv", arr, delimiter=",") READ MORE

Jul 3, 2018 in Python by Hamartia's Mask
• 1,580 points
599 views
+1 vote
1 answer

how to convert json to csv or to store in sql

You can convert JSON data to csv ...READ MORE

Jul 2, 2018 in Python by Nietzsche's daemon
• 4,260 points
2,007 views
0 votes
2 answers

Lists and Tuples

Lists are mutable homogeneous sequences whereas tuples ...READ MORE

Jul 17, 2018 in Python by Mrunal
• 680 points
488 views
0 votes
1 answer

Append & Extend

Hi. This question has already been answered. Take ...READ MORE

Jul 2, 2018 in Python by Nietzsche's daemon
• 4,260 points
752 views
0 votes
1 answer

Searching for substrings

Use the in operator to do this. If ...READ MORE

Jun 28, 2018 in Python by Hamartia's Mask
• 1,580 points
353 views
0 votes
1 answer

Convert dictionary keys to a list

list.(dictionary.keys()) READ MORE

Jun 28, 2018 in Python by Hamartia's Mask
• 1,580 points
398 views
0 votes
1 answer

Multiple line comment in python

No, you can simply use triple codes ...READ MORE

Jun 28, 2018 in Python by v.liyyah
• 1,300 points
447 views
0 votes
1 answer

How to get text label from SAP using pywinauto[python]

Hi. Can you please tell me what ...READ MORE

Jun 28, 2018 in Python by Nietzsche's daemon
• 4,260 points
2,359 views
0 votes
1 answer

Modules and Packages

A module is a single file imported ...READ MORE

Jun 27, 2018 in Python by Hamartia's Mask
• 1,580 points
452 views
0 votes
1 answer

Representing infinity

import math infinity = math.inf Now you can use ...READ MORE

Jun 27, 2018 in Python by Hamartia's Mask
• 1,580 points
520 views
0 votes
1 answer

Chaining comparision

I assume you are talking about this ...READ MORE

Jun 26, 2018 in Python by Hamartia's Mask
• 1,580 points
444 views
0 votes
1 answer

ImportError: No module named requests

Requests is not available for use by ...READ MORE

Jun 26, 2018 in Python by Hamartia's Mask
• 1,580 points
2,298 views
0 votes
3 answers

how to use print statement in python3?

Brackets are required to print the output. >>> ...READ MORE

Nov 25, 2021 in Python by anonymous
1,355 views
0 votes
1 answer

convert integer to strings

Yes, you can str() function. For example: a=10 str(a) output-' ...READ MORE

Jun 26, 2018 in Python by code.reaper12
• 3,500 points
325 views
0 votes
1 answer

Copying dictionaries

Deep copy -  dict2 = dict(dict1) Shallow copy - dict2 ...READ MORE

Jun 25, 2018 in Python by Hamartia's Mask
• 1,580 points
455 views
0 votes
1 answer

Difference between pop and delete methods

I think you mean del() and not ...READ MORE

Jun 25, 2018 in Python by Hamartia's Mask
• 1,580 points
1,856 views
0 votes
1 answer

.pyc files in python

.pyc files contain the bytecode which are ...READ MORE

Jun 22, 2018 in Python by Hamartia's Mask
• 1,580 points
741 views
0 votes
1 answer

List all contents of a folder

Use listfor() from the os library READ MORE

Jun 22, 2018 in Python by Hamartia's Mask
• 1,580 points
439 views
0 votes
1 answer

Call a shell command in Python?

Try this - os.system("commands and arguments") READ MORE

Jun 21, 2018 in Python by Hamartia's Mask
• 1,580 points
512 views
0 votes
1 answer

dunder main in python

It is a check to see if ...READ MORE

Jun 21, 2018 in Python by Hamartia's Mask
• 1,580 points
787 views
0 votes
1 answer

Deleting files

Use the rmtree() method from shutil library. ...READ MORE

Jun 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
312 views