kmeans clustering

2019-09-15 Thread Sharan Basappa
Can someone please help me to clarify the different between fit and predict functions of kmeans? -- https://mail.python.org/mailman/listinfo/python-list

Re: numpy array - convert hex to int

2019-09-09 Thread Sharan Basappa
On Sunday, 8 September 2019 11:16:52 UTC-4, Luciano Ramalho wrote: > >>> int('C0FFEE', 16) > 12648430 > > There you go! > > On Sun, Sep 8, 2019 at 12:02 PM Sharan Basappa > wrote: > > > > I have a numpy array that has data in the form of hex. >

Re: issue in handling CSV data

2019-09-09 Thread Sharan Basappa
On Sunday, 8 September 2019 12:45:45 UTC-4, Peter J. Holzer wrote: > On 2019-09-08 05:41:07 -0700, Sharan Basappa wrote: > > On Sunday, 8 September 2019 04:56:29 UTC-4, Andrea D'Amore wrote: > > > On Sun, 8 Sep 2019 at 02:19, Sharan Basappa > > > wrote: > > &

numpy array - convert hex to int

2019-09-08 Thread Sharan Basappa
I have a numpy array that has data in the form of hex. I would like to convert that into decimal/integer. Need suggestions please. -- https://mail.python.org/mailman/listinfo/python-list

Re: issue in handling CSV data

2019-09-08 Thread Sharan Basappa
On Sunday, 8 September 2019 04:56:29 UTC-4, Andrea D'Amore wrote: > On Sun, 8 Sep 2019 at 02:19, Sharan Basappa wrote: > This is the error: > > my_data_3 = my_data_2.astype(np.float) > > could not convert string to float: " "81 > > > As you can see, t

Re: issue in handling CSV data

2019-09-07 Thread Sharan Basappa
On Saturday, 7 September 2019 21:18:11 UTC-4, MRAB wrote: > On 2019-09-08 01:19, Sharan Basappa wrote: > > I am trying to read a log file that is in CSV format. > > > > The code snippet is below: > > > > ### > > import matp

issue in handling CSV data

2019-09-07 Thread Sharan Basappa
I am trying to read a log file that is in CSV format. The code snippet is below: ### import matplotlib.pyplot as plt import seaborn as sns; sns.set() import numpy as np import pandas as pd import os import csv from numpy import genfromtxt # read the CSV and get into

Multiple log files using logging module

2019-03-24 Thread Sharan Basappa
I have a test program that imports a design program. Both the programs need to log messages. I have tried the following: 1) Both the programs have the following lines: for handler in logging.root.handlers[:]: logging.root.removeHandler(handler) #Create and configure logger filename =

Re: log file

2019-03-24 Thread Sharan Basappa
On Sunday, 24 March 2019 14:20:36 UTC+5:30, Sharan Basappa wrote: > On Sunday, 24 March 2019 10:57:13 UTC+5:30, Cameron Simpson wrote: > > On 23Mar2019 21:47, Sharan Basappa wrote: > > >On Friday, 22 March 2019 09:13:18 UTC+5:30, MRAB wrote: > > >> On 2019-03-

Re: log file

2019-03-24 Thread Sharan Basappa
On Sunday, 24 March 2019 10:57:13 UTC+5:30, Cameron Simpson wrote: > On 23Mar2019 21:47, Sharan Basappa wrote: > >On Friday, 22 March 2019 09:13:18 UTC+5:30, MRAB wrote: > >> On 2019-03-22 03:25, Sharan Basappa wrote: > >> > I am running a program and even th

Re: log file

2019-03-23 Thread Sharan Basappa
On Friday, 22 March 2019 09:13:18 UTC+5:30, MRAB wrote: > On 2019-03-22 03:25, Sharan Basappa wrote: > > I am running a program and even though the program runs all fine, the log > > file is missing. I have pasted first few lines of the code. > > > > Any suggestion

Re: log file

2019-03-23 Thread Sharan Basappa
On Friday, 22 March 2019 09:09:16 UTC+5:30, adam@gmail.com wrote: > On Thursday, March 21, 2019 at 10:26:14 PM UTC-5, Sharan Basappa wrote: > > I am running a program and even though the program runs all fine, the log > > file is missing. I have pasted first few lines of the

Re: log file

2019-03-23 Thread Sharan Basappa
On Friday, 22 March 2019 09:09:14 UTC+5:30, DL Neil wrote: > On 22/03/19 4:25 PM, Sharan Basappa wrote: > > I am running a program and even though the program runs all fine, the log > > file is missing. I have pasted first few lines of the code. > > > > Any suggestion

log file

2019-03-21 Thread Sharan Basappa
I am running a program and even though the program runs all fine, the log file is missing. I have pasted first few lines of the code. Any suggestions where I maybe going wrong? import os import csv import logging import assertion_design as asd import random #Create and configure logger

Re: error while importing a module

2019-03-18 Thread Sharan Basappa
On Tuesday, 19 March 2019 08:34:25 UTC+5:30, Sharan Basappa wrote: > I have a design file that I am importing in a test file to run some tests. > The design file compiles fine when I run it standalone but when I import it > in the test file, I see error on the very first line w

error while importing a module

2019-03-18 Thread Sharan Basappa
I have a design file that I am importing in a test file to run some tests. The design file compiles fine when I run it standalone but when I import it in the test file, I see error on the very first line where I am importing the design file. This is the line from test file: """ test my design

pandas read_csv

2018-11-09 Thread Sharan Basappa
are there any requirements about the format of the CSV file when using read_csv from pandas? For example, is it necessary that the csv file has to have same number of columns in every line etc. I am trying to load a csv file and I get the following error. I really don't know what the issue is

logging output

2018-10-19 Thread Sharan Basappa
I am loading a csv file using Pandas and then logging it back into another file using logging module. Here is one sample line from input file: - 1117838570 2005.06.03 R02-M1-N0-C:J12-U11 2005-06-03-15.42.50.675872 R02-M1-N0-C:J12-U11 RAS KERNEL INFO instruction cache parity error corrected

Re: perplexing error

2018-09-09 Thread Sharan Basappa
On Sunday, 9 September 2018 00:02:49 UTC+5:30, Peter Otten wrote: > Sharan Basappa wrote: > > > I am running a small python code. The main module calls another data > > loader module. I keep this getting this error. > > > > AttributeError: 'str' object has no a

perplexing error

2018-09-08 Thread Sharan Basappa
I am running a small python code. The main module calls another data loader module. I keep this getting this error. AttributeError: 'str' object has no attribute 'raw_data' I tried few things in the code and finally realized that no matter the line number is 68 of data loader module. Of

Re: Module not found

2018-08-28 Thread Sharan Basappa
On Monday, 27 August 2018 22:45:47 UTC+5:30, Peter Otten wrote: > Sharan Basappa wrote: > > > I am running a program that I got as reference from GitHub. > > I am running on windows OS. > > > > Here is a snippet of the code (initial few lines). > > > &

Module not found

2018-08-27 Thread Sharan Basappa
I am running a program that I got as reference from GitHub. I am running on windows OS. Here is a snippet of the code (initial few lines). #!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Shilin He' import sys sys.path.insert(0, 'D:\Projects\Initiatives\machine

Synax error in string assignment

2018-08-18 Thread Sharan Basappa
I am not sure what the issue is with the 2nd file that assigns string to text variable. Here is the code: # -*- coding: utf-8 -*- text = “this’s a sent tokenize test. this is sent two. is this sent three? sent 4 is cool! Now it’s your turn.” from nltk.tokenize import sent_tokenize

plot not showing up

2018-08-10 Thread Sharan Basappa
What is wrong with the following code. Python does not show the plot. from sklearn.datasets import load_digits from sklearn.cluster import KMeans import matplotlib.pyplot as plt digits = load_digits() digits.data.shape kmeans = KMeans(n_clusters=10,random_state=0) clusters =

Re: machine learning forums

2018-08-06 Thread Sharan Basappa
On Monday, 6 August 2018 09:21:03 UTC+5:30, downtime wrote: > You might also try courses on Udemy and Udacity. I know Udemy is always > having sales on courses for like $10.99. They have beginner/novice > courses for all kinds of topics and in my experience, there are some > pretty good ones.

Re: machine learning forums

2018-08-06 Thread Sharan Basappa
> > I am quite new to Python. I am learning Python as I am interested in > > machine learning. The issue is, I have not found any ML forum where > > novices like me can get help. I have tried reddit and each of my posts > > have gone unanswered. > > Which subreddits have you posted to? its

machine learning forums

2018-08-05 Thread Sharan Basappa
I am quite new to Python. I am learning Python as I am interested in machine learning. The issue is, I have not found any ML forum where novices like me can get help. I have tried reddit and each of my posts have gone unanswered. Looks like reddit forum prefers either abstract topics on ML or

Re: list of lists

2018-07-23 Thread Sharan Basappa
On Sunday, 22 July 2018 21:07:17 UTC+5:30, Thomas Jollans wrote: > On 22/07/18 14:53, Sharan Basappa wrote: > > Thanks. I initially thought about this but did not know if this is legal > > syntax. > > In this kind of situation – you think you know how to do something but &g

Re: list of lists

2018-07-22 Thread Sharan Basappa
perator: > > li = [1, 2, 3, 4] > a, b, *c = li > > which is equivalent to: > >a = li[0] >b = li[1] >c = li[2:] > > > ​Iwo Herka > https://github.com/IwoHerka​ > > ‐‐‐ Original Message ‐‐‐ > > On 22 July 2018 12:40 PM, Sh

Re: list of lists

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 18:15:23 UTC+5:30, Frank Millman wrote: > "Sharan Basappa" wrote in message > news:8e261f75-03f7-4f80-a516-8318dd138...@googlegroups.com... > > > > I am using a third party module that is returning list of lists. > > I am using the exam

coding style - where to declare variables

2018-07-22 Thread Sharan Basappa
In other programming languages (e.g. C, C++), as a good practice, variables are declared right at the start of the program, irrespective of where it is normally used. What is the practice in Python? I see that, most of the code, declare variables where it is used and not at the start of the

Re: list of lists

2018-07-22 Thread Sharan Basappa
Thanks. This works in my example. Can you tell me how this works? > You can simply unpack the inner list: > > a, b = results[0] > > > Iwo Herka > > ‐‐‐ Original Message ‐‐‐ > > On 22 July 2018 11:47 AM, Sharan Basappa wrote: > > > ​​ &

list of lists

2018-07-22 Thread Sharan Basappa
I am using a third party module that is returning list of lists. I am using the example below to illustrate. 1 results = [['1', 0.99921393753233001]] 2 k = results[0] 3 print k[0] 4 print k[1] Assume the line 1 is what is returned. I am assigning that to another list (k on line 2) and then

Re: print & string formatting

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 10:24:55 UTC+5:30, Cameron Simpson wrote: > On 21Jul2018 21:33, Sharan Basappa wrote: > >I get a lot confused while using print functions in Python. > > > >For example, I get the same results for the following code: > > > >str = "one

Re: functions vs methods

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 13:32:16 UTC+5:30, Ben Finney wrote: > Sharan Basappa writes: > > > Is there a difference between functions and methods in Python. > > Python's documentation includes a useful Glossary. See the terms > https://docs.python.org/3/glossary.html

print & string formatting

2018-07-21 Thread Sharan Basappa
Folks, I get a lot confused while using print functions in Python. For example, I get the same results for the following code: str = "one two three" print str print "%s" %(str) So, what is the need to use the second method which I see being used in many programs I am referring to --

Re: functions vs methods

2018-07-21 Thread Sharan Basappa
Thanks a lot. On Sunday, 22 July 2018 04:02:23 UTC+5:30, Rick Johnson wrote: > On Saturday, July 21, 2018 at 2:06:21 PM UTC-5, Sharan Basappa wrote: > > Is there a difference between functions and methods in Python. > > Generally speaking, functions and methods are basica

functions vs methods

2018-07-21 Thread Sharan Basappa
Is there a difference between functions and methods in Python. For example, this is the text from tutorialpoint on Python: Python includes the following list functions - cmp, len etc. Python includes following list methods - append, count A related question. Refer to the following lines: 1)

Re: testing code

2018-07-08 Thread Sharan Basappa
On Sunday, 8 July 2018 12:42:07 UTC+5:30, Christian Gollwitzer wrote: > Am 08.07.18 um 06:21 schrieb Sharan Basappa: > > sorry. there was a copy paste error when i posted. I pasted test_2.py for > > both the files: > > > > here are the files again. The issue remains.

Re: testing code

2018-07-08 Thread Sharan Basappa
On Sunday, 8 July 2018 11:52:39 UTC+5:30, Jim Lee wrote: > On 07/07/18 21:21, Sharan Basappa wrote: > > > > sorry. there was a copy paste error when i posted. I pasted test_2.py for > > both the files: > > > > here are the files again. The issue remains. >

Re: testing code

2018-07-07 Thread Sharan Basappa
On Saturday, 7 July 2018 18:22:23 UTC+5:30, Chris Angelico wrote: > On Sat, Jul 7, 2018 at 10:02 PM, Sharan Basappa > wrote: > > On Friday, 6 July 2018 09:22:31 UTC+5:30, Chris Angelico wrote: > >> On Fri, Jul 6, 2018 at 12:56 PM, Sharan Basappa > >> wr

Re: testing code

2018-07-07 Thread Sharan Basappa
On Friday, 6 July 2018 09:22:31 UTC+5:30, Chris Angelico wrote: > On Fri, Jul 6, 2018 at 12:56 PM, Sharan Basappa > wrote: > > Please let me know if the following understanding of mine is correct. > > I need to put the program code in a separate file and organize every &

Re: testing code

2018-07-06 Thread Sharan Basappa
On Friday, 6 July 2018 09:22:31 UTC+5:30, Chris Angelico wrote: > On Fri, Jul 6, 2018 at 12:56 PM, Sharan Basappa > wrote: > > Please let me know if the following understanding of mine is correct. > > I need to put the program code in a separate file and organize every &

Re: testing code

2018-07-06 Thread Sharan Basappa
On Friday, 6 July 2018 09:32:08 UTC+5:30, Cameron Simpson wrote: > On 05Jul2018 19:56, Sharan Basappa wrote: > >I have implemented my first program in python that uses ML to do some > >classification task. The whole code is in a single file currently. > >It contains ex

testing code

2018-07-05 Thread Sharan Basappa
Hi All, I am new to Python though not new to programming. I have implemented my first program in python that uses ML to do some classification task. The whole code is in a single file currently. It contains executable code as well as functions. At the end of the program, I have series of calls

logging module

2018-07-01 Thread Sharan Basappa
Folks, I am trying to use logging module and somehow I cannot make it work. A simple code that I am trying is below. The commented code line 5,6 are other options I have tried but don't work #importing module import logging #Create and configure logger

$s and %d in python

2018-06-30 Thread Sharan Basappa
Is there any difference in %d and %s below. I get the same result: my_name = 'Zed A. Shaw' my_age = 35 # not a lie my_height = 74 # inches print "Let's talk about %s." % my_name print "He's %d inches tall." % my_height print "He's %s inches tall." % my_height Let's talk about Zed A. Shaw. He's

Logger option

2018-06-30 Thread Sharan Basappa
Can anyone tell me if there are some good logger modules in Python. I have tried both logging and trace in Canopy and both are not working. Any help is appreciated. -- https://mail.python.org/mailman/listinfo/python-list

using trace module in enthought

2018-06-30 Thread Sharan Basappa
I am using enthought for python. Trace module seems to be very useful for my work but somehow I am unable to make it work. When I use the following option, I get the following error: %run -m trace --trace "D:/Projects/Initiatives/machine learning/programs/debug_1.py" UsageError: option --trace

Re: error in os.chdir

2018-06-30 Thread Sharan Basappa
On Saturday, 30 June 2018 18:55:53 UTC+5:30, Karsten Hilbert wrote: > On Sat, Jun 30, 2018 at 05:46:59AM -0700, Sharan Basappa wrote: > > > > >> The quick fix: > > > >> > > > >> put an r in front of the directory string: r'...' > > >

is my interpreation correct

2018-06-30 Thread Sharan Basappa
A code I am using as reference has the following line: from nltk.stem.lancaster import LancasterStemmer I am inferring the following based on above: 1) nltk is a package 2) nltk itself may have module because I see - nltk.word_tokenize(pattern['sentence']) in the code 3) nltk has a package named

Re: list initialize with ?

2018-06-30 Thread Sharan Basappa
On Saturday, 30 June 2018 17:48:05 UTC+5:30, Steven D'Aprano wrote: > On Sat, 30 Jun 2018 04:50:10 -0700, Sharan Basappa wrote: > > > Can anyone explain to me what the ? does here: > > > > ignore_words = ['?'] > > Its a question mark inside a string, which

Re: error in os.chdir

2018-06-30 Thread Sharan Basappa
On Saturday, 30 June 2018 18:05:02 UTC+5:30, Steven D'Aprano wrote: > On Sat, 30 Jun 2018 04:47:44 -0700, Sharan Basappa wrote: > > >> The quick fix: > >> > >> put an r in front of the directory string: r'...' > > > > thanks. That works > > P

list initialize with ?

2018-06-30 Thread Sharan Basappa
Can anyone explain to me what the ? does here: ignore_words = ['?'] -- https://mail.python.org/mailman/listinfo/python-list

Re: error in os.chdir

2018-06-30 Thread Sharan Basappa
On Saturday, 30 June 2018 16:51:53 UTC+5:30, Karsten Hilbert wrote: > On Sat, Jun 30, 2018 at 04:05:22AM -0700, Sharan Basappa wrote: > > > I need to change directory to my local working directory in windows and > > then open a file for processing. > > Its just

error in os.chdir

2018-06-30 Thread Sharan Basappa
0 down vote favorite I need to change directory to my local working directory in windows and then open a file for processing. Its just a 3 lines code, as below: import csv import os os.chdir('D:\Projects\Initiatives\machine learning\programs\assertion') The error is as follows: WindowsError:

sigmoid function and derivative

2018-06-26 Thread Sharan Basappa
Folks, I know this is not a machine learning forum but I wanted to see if anyone can explain this to me. In artificial neural network, I can understand why sigmoid is used but I see that derivative of sigmoid output function is used. I am not able to understand why. For example: # convert

nltk related issue

2018-06-20 Thread Sharan Basappa
Folks, I am trying to run a simple example associated with nltk. I get some error and I don't know what the issue is. I need some guidance please. I am using python canopy distribution The following is the code: inputstring = ' This is an example sent. The sentence splitter will split on sent

Re: curve_fit in scipy

2018-06-19 Thread Sharan Basappa
> > Secondly, I don't understand how curve_fit knows the number of arguments > > that test_func takes. > > Part of the dynamic nature of Python is that a function carries with it > the number of parameters (as just one among many such properties).  We > call it "introspection" when we examine

curve_fit in scipy

2018-06-19 Thread Sharan Basappa
Hi All, I am working out an exercise on curve_fit function available scipy package. While I understand in general about curve_fit, I am unable to understand the following: params, params_covariance = optimize.curve_fit(test_func, x_data, y_data,

Re: syntax difference

2018-06-17 Thread Sharan Basappa
On Sunday, 17 June 2018 11:42:03 UTC+5:30, Jim Lee wrote: > On 06/16/2018 10:13 PM, Sharan Basappa wrote: > > I think I am now confused with format options in Python. > > I tried an example as below and both print proper value: > > > > age = 35 > > > > print

Re: syntax difference

2018-06-17 Thread Sharan Basappa
On Sunday, 17 June 2018 11:00:50 UTC+5:30, Ben Finney wrote: > Sharan Basappa writes: > > > I think I am now confused with format options in Python. > > You should refer to the documentation for string formatting > https://docs.python.org/3/library/stdtypes.htm

Re: syntax difference

2018-06-16 Thread Sharan Basappa
On Sunday, 17 June 2018 07:25:57 UTC+5:30, Ben Bacarisse wrote: > Cameron Simpson writes: > > > ... In Python 3 we have "format strings", which let you write: > > > > name = "Sharon" > > age = 35 > > print(f"The person named {name|r} is {age} years old.") > > You meant {name!r} I think

syntax difference

2018-06-16 Thread Sharan Basappa
Is there a difference between these prints. The first one looks a bit complex. So, why should it be used? my_age = 35 # not a lie print "my age %s." % my_age print "my age ", my_age Output: %run "D:/Projects/Initiatives/machine learning/programs/five.py" my age 35. my age 35 --

Re: pattern

2018-06-16 Thread Sharan Basappa
TC+5:30, Cameron Simpson wrote: > On 14Jun2018 20:01, Sharan Basappa wrote: > >> >Can anyone explain to me the purpose of "pattern" in the line below: > >> > > >> >documents.append((w, pattern['class'])) > >> > > >> >document

Re: pattern

2018-06-14 Thread Sharan Basappa
> >Can anyone explain to me the purpose of "pattern" in the line below: > > > >documents.append((w, pattern['class'])) > > > >documents is declared as a list as follows: > >documents.append((w, pattern['class'])) > > Not without a lot more context. Where did you find this code? > > Cheers, I am

Re: mutable sequences

2018-06-14 Thread Sharan Basappa
Thanks, All, for the responses. -- https://mail.python.org/mailman/listinfo/python-list

pattern

2018-06-14 Thread Sharan Basappa
Can anyone explain to me the purpose of "pattern" in the line below: documents.append((w, pattern['class'])) documents is declared as a list as follows: documents.append((w, pattern['class'])) -- https://mail.python.org/mailman/listinfo/python-list

mutable sequences

2018-06-13 Thread Sharan Basappa
The term mutable appears quite often in Python. Can anyone explain what is meant by mutable and immutable sequences. For example, Python lists are mutable. BTW, is the below explanation correct (it is taken from a book I am reading) Python lists are mutable sequences. They are very similar to

user defined modules

2018-06-04 Thread Sharan Basappa
Is there a specific location where user defined modules need to be kept? If not, do we need to specify search location so that Python interpreter can find it? Also, when does Python interpreter compile the module code? When it is imported? -- https://mail.python.org/mailman/listinfo/python-list

syntax question

2018-06-02 Thread Sharan Basappa
Can anyone please tell me what the following line in a python program does: line = lambda x: x + 3 I have pasted the entire code below for reference: from scipy.optimize import fsolve import numpy as np line = lambda x: x + 3 solution = fsolve(line, -2) print solution --

Numpy array

2018-05-18 Thread Sharan Basappa
This is regarding numpy array. I am a bit confused how parts of the array are being accessed in the example below. 1 import scipy as sp 2 data = sp.genfromtxt("web_traffic.tsv", delimiter="\t") 3 print(data[:10]) 4 x = data[:,0] 5 y = data[:,1] Apparently, line 3 prints the first 10 entries in

Re: PIP install

2018-05-11 Thread Sharan Basappa
On Saturday, 12 May 2018 08:32:04 UTC+5:30, MRAB wrote: > On 2018-05-12 03:47, Sharan Basappa wrote: > > I have installed Python recently. Do I need to install PIP separately or > > this would be part of default installation. When I run pip install <>, > > windows com

issue runing ipython

2018-05-11 Thread Sharan Basappa
I see an issue while running ipython. Can anyone help please. D:\Users\sharanb>ipython notebook [TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and will be removed in future versions. [TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook` in the

PIP install

2018-05-11 Thread Sharan Basappa
I have installed Python recently. Do I need to install PIP separately or this would be part of default installation. When I run pip install <>, windows complains that no such command exists -- https://mail.python.org/mailman/listinfo/python-list

Re: Module, Package

2018-05-08 Thread Sharan Basappa
On Tuesday, 8 May 2018 13:05:58 UTC+5:30, Steven D'Aprano wrote: > On Mon, 07 May 2018 09:53:45 -0700, Sharan Basappa wrote: > > > I am a bit confused between module and package in Python. Does a module > > contain package or vice versa? When we import something in Python

Re: Module, Package

2018-05-07 Thread Sharan Basappa
MRAB, ChirisA, One question. So, we can import the entire package or just a module in a given package. Is this correct? For example, import nltk import nltk.stem -- https://mail.python.org/mailman/listinfo/python-list

Re: Module, Package

2018-05-07 Thread Sharan Basappa
On Monday, 7 May 2018 23:09:41 UTC+5:30, Chris Angelico wrote: > On Tue, May 8, 2018 at 2:53 AM, Sharan Basappa <sharan.basa...@gmail.com> > wrote: > > I am a bit confused between module and package in Python. > > Does a module contain package or vice versa? >

Module, Package

2018-05-07 Thread Sharan Basappa
I am a bit confused between module and package in Python. Does a module contain package or vice versa? When we import something in Python, do we import a module or a package? Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: write to file

2018-05-06 Thread Sharan Basappa
On Sunday, 6 May 2018 10:48:12 UTC+5:30, Chris Angelico wrote: > On Sun, May 6, 2018 at 3:10 PM, Sharan Basappa <sharan.basa...@gmail.com> > wrote: > > On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote: > >> On Sat, 05 May 2018 08:45:39

Re: write to file

2018-05-05 Thread Sharan Basappa
On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote: > On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote: > > > Thanks a lot. I have actually tried print with file handle as a > > parameter (the last option). I see that the file is created but not

Re: write to file

2018-05-05 Thread Sharan Basappa
On Saturday, 5 May 2018 22:05:53 UTC+5:30, Mark Lawrence wrote: > On 05/05/18 12:25, Sharan Basappa wrote: > > In my program, I have print statements for debugging. > > However, these are cluttering the display. So, I am trying to save > > these to a file but somehow I cant s

Re: write to file

2018-05-05 Thread Sharan Basappa
On Saturday, 5 May 2018 19:00:12 UTC+5:30, Steven D'Aprano wrote: > On Sat, 05 May 2018 04:25:50 -0700, Sharan Basappa wrote: > > > In my program, I have print statements for debugging. However, these are > > cluttering the display. So, I am trying to save these to a file but

write to file

2018-05-05 Thread Sharan Basappa
In my program, I have print statements for debugging. However, these are cluttering the display. So, I am trying to save these to a file but somehow I cant seem to get it correct. For example, the following are the print statement in my program: print("target_names\n",target_names) To print to a

Re: ipython install

2018-05-05 Thread Sharan Basappa
On Saturday, 5 May 2018 15:39:32 UTC+5:30, Sharan Basappa wrote: > On Saturday, 5 May 2018 15:02:33 UTC+5:30, Steven D'Aprano wrote: > > On Sat, 05 May 2018 00:20:26 -0700, Sharan Basappa wrote: > > > > > After this, when I type ipython on command prompt, I don't

Re: ipython install

2018-05-05 Thread Sharan Basappa
On Saturday, 5 May 2018 15:02:33 UTC+5:30, Steven D'Aprano wrote: > On Sat, 05 May 2018 00:20:26 -0700, Sharan Basappa wrote: > > > After this, when I type ipython on command prompt, I don't get anything > > on my windows. > > You don't get *anything*? Not even an error

ipython install

2018-05-05 Thread Sharan Basappa
I am trying to install ipython. I already have python installed. When I type "pip install ipython" I get the following messages: Requirement already satisfied: setuptools>=18.5 in d:\users\sharanb\appdata\local\programs\python\python36-32\lib\site-packages (from ipython) Requirement already

Re: Plot not working

2018-05-05 Thread Sharan Basappa
On Saturday, 5 May 2018 10:59:13 UTC+5:30, John Ladasky wrote: > On Friday, May 4, 2018 at 9:13:02 PM UTC-7, Sharan Basappa wrote: > > I am new to Python and using it to learn machine learning. > > > > Below is a sample program I am running to plot IRIS data set. > >

Plot not working

2018-05-04 Thread Sharan Basappa
I am new to Python and using it to learn machine learning. Below is a sample program I am running to plot IRIS data set. The code runs but no plot comes up. I am not sure what the issue is with the code. # Imports from matplotlib import pyplot as plt from sklearn.datasets import load_iris