Re: Improve Python + Influxdb import performance

2017-04-10 Thread Prathamesh
Hi

I've installed Jython 2.7 and was able to get weblogic running as a Jython 2.7 
module following
https://technology.amis.nl/2015/10/04/how-to-use-wlst-as-a-jython-2-7-module/

I got the requests module 2.7 installed as well

But am facing an issue when invoking it
related to SSL certificates
and to stop those errors I think you need utillib2/utillib3
and that has dependencies
one of which is cryptography - which is a real pain to install

Any pointers on this
or easier way to install this?
I'm running Windows 2008R2

Also my pip install doesn't work
I get geteid error

Please let me know

Thanks
P

On Tuesday, April 4, 2017 at 6:51:28 PM UTC+5:30, Prathamesh wrote:
> Hi Inada
> 
> Thank you for your response
> Weblogic works on Jython 2.2.1
> and I think the Python requests module requires >= python 2.6
> 
> Please correct me if I'm wrong
> or if there is another way to get this to work
> 
> Thanks
> P
> 
> On Monday, April 3, 2017 at 9:52:38 PM UTC+5:30, INADA Naoki wrote:
> > You can reuse connection, instead of creating for each request. (HTTP
> > keep-alive).
> > 
> > On Tue, Apr 4, 2017 at 1:11 AM, Prathamesh  
> > wrote:
> > > Hello World
> > >
> > > The following script is an extract from
> > >
> > > https://github.com/RittmanMead/obi-metrics-agent/blob/master/obi-metrics-agent.py
> > >
> > > <>
> > >
> > > import calendar, time
> > > import sys
> > > import getopt
> > >
> > > print '---'
> > >
> > > # Check the arguments to this script are as expected.
> > > # argv[0] is script name.
> > > argLen = len(sys.argv)
> > > if argLen -1 < 2:
> > > print "ERROR: got ", argLen -1, " args, must be at least two."
> > > print '$FMW_HOME/oracle_common/common/bin/wlst.sh 
> > > obi-metrics-agent.py
> > > [] [] [] [ > > port>] [targetDB influx db>'
> > > exit()
> > >
> > > outputFormat='CSV'
> > > url='t3://localhost:7001'
> > > targetHost='localhost'
> > > targetDB='obi'
> > > targetPort='8086'
> > >
> > > try:
> > > wls_user = sys.argv[1]
> > > wls_pw = sys.argv[2]
> > > url  = sys.argv[3]
> > > outputFormat=sys.argv[4]
> > > targetHost=sys.argv[5]
> > > targetPort=sys.argv[6]
> > > targetDB=sys.argv[7]
> > > except:
> > > print ''
> > >
> > > print wls_user, wls_pw,url, outputFormat,targetHost,targetPort,targetDB
> > >
> > > now_epoch = calendar.timegm(time.gmtime())*1000
> > >
> > > if outputFormat=='InfluxDB':
> > > import httplib
> > > influx_msgs=''
> > >
> > > connect(wls_user,wls_pw,url)
> > > results = displayMetricTables('Oracle_BI*','dms_cProcessInfo')
> > > for table in results:
> > > tableName = table.get('Table')
> > > rows = table.get('Rows')
> > > rowCollection = rows.values()
> > > iter = rowCollection.iterator()
> > > while iter.hasNext():
> > > row = iter.next()
> > > rowType = row.getCompositeType()
> > > keys = rowType.keySet()
> > > keyIter = keys.iterator()
> > > inst_name= row.get('Name').replace(' ','-')
> > > try:
> > > server= row.get('Servername').replace(' 
> > > ','-').replace('/','_')
> > > except:
> > > try:
> > > server= row.get('ServerName').replace(' 
> > > ','-').replace('/','_')
> > > except:
> > > server='unknown'
> > > try:
> > > host= row.get('Host').replace(' ','-')
> > > except:
> > > host=''
> > > while keyIter.hasNext():
> > > columnName = keyIter.next()
> > > value = row.get(columnName )
> > > if columnName.find('.value')>0:
> > > metric_name=columnName.replace('.value','')
> > > if value is not None:
> > > if value != 0:
> > > if outputFormat=='InfluxDB':
> > > influx_msg= 
> > > ('%s,server=%s,host=%s,metric_group=%s,metric_instance=%s value=%s %s') % 
> > > (metric_name,server,host,tableName,inst_name,  value,now_epoch*100)
> > > influx_msgs+='\n%s' % influx_msg
> > > conn = httplib.HTTPConnection('%s:%s' % 
> > > (targetHost,targetPort))
> > > ## TODO pretty sure should be urlencoding 
> > > this ...
> > > a=conn.request("POST", ("/write?db=%s" % 
> > > targetDB), influx_msg)
> > > r=conn.getresponse()
> > >
> > > <>
> > >
> > > It currently takes about 3 minutes to execute completely and I was 
> > > thinking of a way to make it run faster
> > >
> > > Data alignment (Influx line protocol) & data loading - done together 
> > > takes up most of the time
> > >
> > > Influxdb is currently loading data at around 3 points/second
> > >
> > > Any way to align the data separately, store it and load it as a batch?
> > >
> > > I feel that would help improve performance
> > >
> > > Please let me know if you have 

Re: Python and the need for speed

2017-04-10 Thread bartc

On 10/04/2017 03:40, Rick Johnson wrote:

On Sunday, April 9, 2017 at 1:34:39 PM UTC-5, bartc wrote:



I have my own interpreted language which I call 'dynamic',
but compared with Python, code in it might as well be set
in concrete.


Is this a personal toy, or something that you can share a
link to?


It's a personal thing but not a toy. Some more info here:

https://github.com/bartg/langs/tree/master/qlang

Click on the 'Q Features' link, this includes a selection of built-in 
features that have been easily and efficiently implemented 
(enumerations, records etc) which Python seems to have trouble with.


(And it can't have simple enumerations such that cat=1, dog=2, but needs 
to have every conceivable embellishment. In other words it doesn't know 
how to keep things simple.)


(To actually run this, there still appears to be a file 'pcc.c' at the 
top level of that github project. This is an old C version of the 
interpreter (yes, just one file) and it seemed to work when I tried it 
just now. You need a 32-bit C compiler. I had to remove a binary version 
(for Windows) when someone said github doesn't allow binaries.)



For all the hype about GvR's "supposed" time machine, we can
see that Python has suffered some major design flaws. And
since Python3000, feature creep has been churning into
overdrive.


Yes. I suppose when it gets to a point where there are so many features 
anyway, adding a few more makes little difference!


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


RE: Swiss Ephemeris

2017-04-10 Thread Adriaan Renting

There are at least two other packages with Python bindings that allow
ephimerides calculations.

1) PyEphem http://rhodesmill.org/pyephem/
2) Pyraphttp://www.astron.nl/casacore/trunk/pyrap/docs/ (This needs a
very big casacore c++ library and thus a pain to compile, but can give
second level accuracy if you use updated IERS tables).

As to the ancient's (Greek/Roman) nature philosophy. We still use some
of it today, especially in the fields of mathematics, mechanics and
observational astronomy, but their understanding of biology and
especially the human body was entirely incorrect.

Western/Islamic medicine largely followed Hippocrates for nearly 2000
years (although the ideas are originally from Indian Ayurveda) and some
of the methods had some merit, but overall the treatments were often
worse than the disease, for example George Washinton was almost
certainly killed by his doctors.
Only with the application of the scientific method to medicine after
the enlightenment have we started to make any real progress. The most
important of which is blind trials in which a treatment needs to show to
be better than a placebo.

One of the most important things that modern medicine has shown is that
a placebo can have a real effect and cure people. Some people do get
better after you give them a sugar pill or its equivalent.
As humans we're also very good at seeing correlation and causation when
none might exist. Matt Parker has a very entertaining talk about this
here https://www.youtube.com/watch?v=sf5OrthVRPA

Cheers,

Adriaan Renting

P.S. I had an uncle who died of cancer 2 years ago who was a firm
believer in all kinds of non-mainstream cures and tried all kinds of
alternative cures from accupuncture to yoga to Gc-MAF. In the end the
only results I saw were that these people got many 10.000s euros from
him and he died very disillusioned and poor as these were not covered by
his health insurance. I learned a lot about magazines like "What doctors
don't tell you" - which use the images of people in white labcoats to
sell you things that doctors don't tell you about because they are known
to be ineffective or even bad for you. I understand that a lot of people
have a problem with authority and/or look for alternatives if mainstream
medicine can't help them. And sometimes the methods seem to work and
those are the stories you hear, as the other people end up like my
uncle, who's not here any more to tell his story. Don't end up like my
uncle.

 >>>
> Fully recognizing that most of what you wrote was tongue-in-cheek, I
> just want to say that regardless of the wonders of modern medicine,
it's
> a pity they learn so little about successful medicines other than
their
> own. In other academic scientific disciplines such as physics and
> chemistry it's not uncommon to see history of science courses in the
> curriculum. But not in medicine. I learned what I know about ancient
> Greek science from a university physics professor, though I doubt he
> would ever have guessed that one of his students would someday
breathe
> new life into that ancient science by attempting to ressurrect it.
The
> great ancients were no less endowed with intelligence than we are,
they
> simply directed it to different ends.
> 
> 
> Rick Johnson wrote, on Sunday, April 09, 2017 9:00 PM
>> 
>> On Sunday, April 9, 2017 at 8:52:44 PM UTC-5, Deborah Swanson
wrote:
>> > PS. I've been using medical astrology to look ahead at my medical

>> > condition for years in advance. And being off by a day or 
>> so doesn't 
>> > matter that much when you're looking at trends over the course of

>> > years and decades. I also have a little software widget to 
>> look at the 
>> > planetary data in graphical chart form at any particular 
>> second, also 
>> > based on sweph, which has been quite astoundingly accurate in
>> > following the rather complex kaleidoscope of my symptoms
>> > during the course of a day. (Though it doesn't do you a bit
>> > of good if you forget to look! Which is my entire
>> > motivation to get it encoded and available with a few
>> > clicks.) And it is quite useful to know in advance what
>> > will be happening when, and most importantly when it will
>> > stop. Knowledge is power!
>> 
>> It's simply amazing what technology can do these days. And
>> with medical diagnosis now just a few clicks away, someone 
>> really should tell those medical students to stop wasting 
>> time and money at university.
>> 
>> > Caveat. This kind of precision and accuracy is only found
>> > in the specific forms of astrology which relate to pure physical 
>> > phenomena, and most of what you see these days masquerading as 
>> > astrology is pure hooey, almost entirely invented on a 
>> large scale in 
>> > the Middle Ages and flowered in the Renaissance.
>> 
>> Whadda coinicidence, as did alchemy!
>> 
>> > By pure physical phenomena, which is the only phenomena
>> > that is at least debatably influenced by physical planetary 
>> forces, I 
>> > mean thi

Re: Python and the need for speed

2017-04-10 Thread Mikhail V
On 10 April 2017 at 02:21, Gregory Ewing  wrote:
>
> 
>
> My take on the idea of making Python less dynamic in order
> to improve speed is that you'll end up with a language that,
> while it may superficially resemble Python, doesn't
> really feel like Python.
>
> Boo is an example of that. It has a Python-like syntax, but
> to get any speed advantage you need to add static type
> delarations, and then it feels more like programming in
> C# than Python. At that point, you wonder whether you might
> just be better off writing your program in C# to begin with.
>
> That's not to say this kind of approach isn't worth pursuing,
> but like the JIT attempts mentioned in the article, it has
> also been tried before, with varying levels of success.

Agree. python is python and I suppose that performance issues
has much to do with types and OOP.
When I first started with python I thought - no, it is not possible
without types, if I'll write something more complicated than
hello world, it will all break at some point.
But hell, this works and works good.

Still I miss some old school features in Python, e.g. "goto" statement would
be very useful in some cases. I know it is considered bad style
to use goto, but in some cases it is just most natural thing to use.

What I am (and probably many people) missing is a good tool for
performance middle- and low-level applications.
For me it would be a coding tool, sort of minimalist IDE, with simple
readable syntax which generates compilable C code.
And it would not be necessarily python-like syntax,
but I tend to agree that for today python's syntax is
most readable.

The problem that many are overlooking still is that the
possibilities for syntaxes are very limited in pure text-mode
presentation.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and the need for speed

2017-04-10 Thread breamoreboy
On Monday, April 10, 2017 at 1:25:48 PM UTC+1, Mikhail V wrote:
> 
> Still I miss some old school features in Python, e.g. "goto" statement would
> be very useful in some cases. I know it is considered bad style
> to use goto, but in some cases it is just most natural thing to use.
> 

http://entrian.com/goto/
https://pypi.python.org/pypi/goto-statement

Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


Pound sign problem

2017-04-10 Thread David Shi via Python-list
In the data set, pound sign escape appears:
u'price_currency': u'\xa3', u'price_formatted': u'\xa3525,000',
When using table.to_csv after importing pandas as pd, an error message persists 
as follows:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 0: 
ordinal not in range(128)

Can anyone help?
Regards.
David
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] txAWS 0.3.0

2017-04-10 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce the release of txAWS 0.3.0.  txAWS is a library for
interacting with
Amazon Web Services (AWS) using Twisted.

You can download the release from PyPI 
 (https://pypi.python.org/pypi/txAWS).

txAWS development uses GitHub for issues and source control
 (https://github.com/twisted/txaws).

Since the last release, the following enhancements have been made:

   - Jean-Paul Calderone added basic Route53 support.
   - Mark Williams add Auth v4, now used by the S3 and Route53 support.
   - Francisco Souza added support for VPCs to some EC2 APIs.
   - Drew Smathers added multi-part S3 upload support.
   - Several people added other S3 client features such as pagination and
   streaming uploads.
   - *txaws.testing* now provides S3 and Route53 support.

Additionally, the following APIs have been deprecated:

   - The *client* attribute of *txaws.client.base.BaseQuery*
   - The *date* attribute of *txaws.s3.client.Query*

Thanks to everyone who contributed and to Least Authority Enterprises
 () for
sponsoring my work on this release.

Jean-Paul Calderone
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pound sign problem

2017-04-10 Thread Ben Finney
David Shi via Python-list  writes:

> When using table.to_csv after importing pandas as pd

I don't know much about that library. What does its documentation say
for the ‘table.to_csv’ function?

Can you write a *very short* complete example, that we can run to
demonstrate the same behaviour you are seeing?

> an error message persists as follows:
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 
> 0: ordinal not in range(128)

This means the function has been told (or is assuming, in the absence of
better information) that the input data is in the ‘ascii’ text encoding.

That assumption turns out to be incorrect, for the actual data you have.
So that error occurs.

You will need to:

* Find out exactly what text encoding was used to write the file. Don't
  guess, because there are many ways to be wrong.

* Specify that encoding to the ‘table.to_csv’ function, or to whatever
  function opens the file. (This might be the Python built-in ‘open’
  function, but we'd need to see your short example to know.)

-- 
 \“Most people, I think, don't even know what a rootkit is, so |
  `\ why should they care about it?” —Thomas Hesse, Sony BMG, 2006 |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pound sign problem

2017-04-10 Thread Peter Otten
David Shi via Python-list wrote:

> In the data set, pound sign escape appears:
> u'price_currency': u'\xa3', u'price_formatted': u'\xa3525,000',
> When using table.to_csv after importing pandas as pd, an error message
> persists as follows: UnicodeEncodeError: 'ascii' codec can't encode
> character u'\xa3' in position 0: ordinal not in range(128)

The default encoding in Python 2 is ascii, and the pound sign is not part of 
that.

> Can anyone help?

Specify an alternative encoding, preferably UTF-8:

>>> import pandas
>>> df = pandas.DataFrame([[u"\xa3123"], [u"\xa3321"]], columns=["Price"])
>>> df
  Price
0  £123
1  £321

[2 rows x 1 columns]
>>> df.to_csv("tmp.csv", encoding="utf-8")
>>> 
$ cat tmp.csv
,Price
0,£123
1,£321
$ 


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.6 printing crashing on OS X 10.12.4

2017-04-10 Thread Ray Cote
On Wed, Apr 5, 2017 at 3:40 PM, Python  wrote:

> Le 05/04/2017 à 20:14, Ray Cote a écrit :
>
>> Hello:
>>
>> Python 3.6 crashing when trying to print from the environment.
>>
>> $ python
>> Python 3.6.1 (default, Mar 22 2017, 15:53:21)
>> [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>>
>>> print("hello")
>

>> Python(53390,0x7fffdd9e63c0) malloc: *** error for object 0x10dde4110:
>> pointer being freed was not allocated
>> *** set a breakpoint in malloc_error_break to debug
>> Abort trap: 6
>>
>>
>> Pastebin link to OS X crash report if that’s helpful:
>> https://pastebin.com/t1j3nz5L
>>
>>
>> 1: Python installed via ports.
>> 2: OS X 10.12.4.
>> 3: Python 3.6.1 (though I also had this problem with 3.6.0).
>> 4: Have successfully run python 3.5 for months.
>> 5: Running under standard terminal program.
>> 6: I have py36-readline installed.
>> 7: Have tried uninstalling and re-installing Python.
>>
>> Any thoughts on what I could have wrong?
>>
>> Regards
>> —Ray
>>
>>
> Mac OS X 10.12.3, Python 3 installed by brew
>
> mac:~$ uname -r
> 16.4.0
> mac:~$ python3
> Python 3.6.0 (default, Mar  4 2017, 12:32:34)
> [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> print("hello")
> hello
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>


Follow up:

Never did find out why the macports Python was crashing.
Switched over to brew and it is working fine.
—R
-- 
https://mail.python.org/mailman/listinfo/python-list


Pillow ImportError: No module named Image

2017-04-10 Thread jorge . conrado

Hi,

I installed the Pillow in my computer. The I did:

import Image, ImageMath

ImportError: No module named Image

Please, what can I do to solve this.

Conrado
--
https://mail.python.org/mailman/listinfo/python-list


Re: Pillow ImportError: No module named Image

2017-04-10 Thread Jon Ribbens
On 2017-04-10, jorge.conr...@cptec.inpe.br  wrote:
> I installed the Pillow in my computer. The I did:
>
> import Image, ImageMath
>
> ImportError: No module named Image

Try:

from PIL import Image, ImageMath
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and the need for speed

2017-04-10 Thread William Ray Wing

> On Apr 10, 2017, at 8:25 AM, Mikhail V  wrote:
> 
> On 10 April 2017 at 02:21, Gregory Ewing  wrote:
>> 
>> 
>> 
>> My take on the idea of making Python less dynamic in order
>> to improve speed is that you'll end up with a language that,
>> while it may superficially resemble Python, doesn't
>> really feel like Python.
>> 
>> Boo is an example of that. It has a Python-like syntax, but
>> to get any speed advantage you need to add static type
>> delarations, and then it feels more like programming in
>> C# than Python. At that point, you wonder whether you might
>> just be better off writing your program in C# to begin with.
>> 
>> That's not to say this kind of approach isn't worth pursuing,
>> but like the JIT attempts mentioned in the article, it has
>> also been tried before, with varying levels of success.
> 
> Agree. python is python and I suppose that performance issues
> has much to do with types and OOP.
> When I first started with python I thought - no, it is not possible
> without types, if I'll write something more complicated than
> hello world, it will all break at some point.
> But hell, this works and works good.
> 
> Still I miss some old school features in Python, e.g. "goto" statement would
> be very useful in some cases. I know it is considered bad style
> to use goto, but in some cases it is just most natural thing to use.
> 
> What I am (and probably many people) missing is a good tool for
> performance middle- and low-level applications.
> For me it would be a coding tool, sort of minimalist IDE, with simple
> readable syntax which generates compilable C code.
> And it would not be necessarily python-like syntax,
> but I tend to agree that for today python's syntax is
> most readable.

Have you considered Swift, now that it is open source?

Bill

> 
> The problem that many are overlooking still is that the
> possibilities for syntaxes are very limited in pure text-mode
> presentation.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pound sign problem

2017-04-10 Thread Lew Pitcher
David Shi wrote:

> In the data set, pound sign escape appears:
> u'price_currency': u'\xa3', u'price_formatted': u'\xa3525,000',
> When using table.to_csv after importing pandas as pd, an error message
> persists as follows: UnicodeEncodeError: 'ascii' codec can't encode
> character u'\xa3' in position 0: ordinal not in range(128)

There is no "pound sign" in ASCII[1]. Try changing your target encoding to 
something other than ASCII.

[1]: See http://std.dkuug.dk/i18n/charmaps/ascii for a list of valid ASCII 
values.

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request


-- 
https://mail.python.org/mailman/listinfo/python-list


Installing Python 3.6.1 on a Windows 10

2017-04-10 Thread Colin J. Williams
   Below is the tail of my Install Log.

   Is this a problem that I should be able to resolve?

   Advice sought.

   C

   Property(S): RedirectedDllSupport = 2
   Property(S): MsiRunningElevated = 1
   Property(S): Privileged = 1
   Property(S): USERNAME = AdminOnly
   Property(S): Installed = 00:00:00
   Property(S): DATABASE = C:\WINDOWS\Installer\3cb4905.msi
   Property(S): OriginalDatabase = C:\WINDOWS\Installer\3cb4905.msi
   Property(S): UILevel = 2
   Property(S): MsiUISourceResOnly = 1
   Property(S): Preselected = 1
   Property(S): ACTION = INSTALL
   Property(S): ROOTDRIVE = E:\
   Property(S): CostingComplete = 1
   Property(S): OutOfDiskSpace = 0
   Property(S): OutOfNoRbDiskSpace = 0
   Property(S): PrimaryVolumeSpaceAvailable = 0
   Property(S): PrimaryVolumeSpaceRequired = 0
   Property(S): PrimaryVolumeSpaceRemaining = 0
   Property(S): INSTALLLEVEL = 1
   MSI (s) (2C:60) [09:00:59:536]: Note: 1: 1724
   MSI (s) (2C:60) [09:00:59:536]: Note: 1: 2205 2:  3: Error
   MSI (s) (2C:60) [09:00:59:536]: Note: 1: 2228 2:  3: Error 4: SELECT
   `Message` FROM `Error` WHERE `Error` = 1724
   MSI (s) (2C:60) [09:00:59:536]: Note: 1: 2205 2:  3: Error
   MSI (s) (2C:60) [09:00:59:536]: Note: 1: 2228 2:  3: Error 4: SELECT
   `Message` FROM `Error` WHERE `Error` = 1709
   MSI (s) (2C:60) [09:00:59:536]: Product: Python 3.6.1 Core Interpreter
   (64-bit symbols) -- Removal completed successfully.

   MSI (s) (2C:60) [09:00:59:536]: Windows Installer removed the product.
   Product Name: Python 3.6.1 Core Interpreter (64-bit symbols). Product
   Version: 3.6.1150.0. Product Language: 1033. Manufacturer: Python Software
   Foundation. Removal success or error status: 0.

   MSI (s) (2C:60) [09:00:59:536]: Deferring clean up of packages/files, if
   any exist
   MSI (s) (2C:60) [09:00:59:536]: MainEngineThread is returning 0
   MSI (s) (2C:DC) [09:00:59:536]: RESTART MANAGER: Session closed.
   MSI (s) (2C:DC) [09:00:59:536]: No System Restore sequence number for this
   installation.
   === Logging stopped: 2017-04-10  9:00:59 ===
   MSI (s) (2C:DC) [09:00:59:551]: User policy value 'DisableRollback' is 0
   MSI (s) (2C:DC) [09:00:59:551]: Machine policy value 'DisableRollback' is
   0
   MSI (s) (2C:DC) [09:00:59:551]: Incrementing counter to disable shutdown.
   Counter after increment: 0
   MSI (s) (2C:DC) [09:00:59:551]: Note: 1: 1402 2:
   
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts
   3: 2
   MSI (s) (2C:DC) [09:00:59:551]: Note: 1: 2265 2:  3: -2147287035
   MSI (s) (2C:DC) [09:00:59:551]: Note: 1: 1402 2:
   
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts
   3: 2
   MSI (s) (2C:DC) [09:00:59:551]: Decrementing counter to disable shutdown.
   If counter >= 0, shutdown will be denied.  Counter after decrement: -1
   MSI (s) (2C:DC) [09:00:59:551]: Post-install cleanup: removing installer
   file 'C:\WINDOWS\Installer\3cb4905.msi'
   MSI (c) (C8:98) [09:00:59:551]: Decrementing counter to disable shutdown.
   If counter >= 0, shutdown will be denied.  Counter after decrement: -1
   MSI (c) (C8:98) [09:00:59:551]: MainEngineThread is returning 0
   === Verbose logging stopped: 2017-04-10  9:00:59 ===
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: using HTTPHandler cause Django server side shows http 400 and Invalid HTTP_HOST header message

2017-04-10 Thread iMath

> Are you sure you posted the code you are actually using? Because the 
> error message suggests a difference.
> 
I am sure !

As I have tested: If I pass the IP address of my web server to the host 
parameter of HTTPHandler, the server side would show http 400 and Invalid 
HTTP_HOST header message  , while if I pass the domain name instead, then the 
view function works as expected . 
 
would it be a bug within HTTPHandler?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: using HTTPHandler cause Django server side shows http 400 and Invalid HTTP_HOST header message

2017-04-10 Thread iMath
On Tuesday, April 11, 2017 at 12:00:27 AM UTC+8, iMath wrote:
> > Are you sure you posted the code you are actually using? Because the 
> > error message suggests a difference.
> > 
> I am sure !
> 
> As I have tested: If I pass the IP address of my web server to the host 
> parameter of HTTPHandler, the server side would show http 400 and Invalid 
> HTTP_HOST header message , 
>  

Besides the http 400 and Invalid HTTP_HOST header message , there are also 
following exceptions 


Invalid HTTP_HOST header: '112.74.98.187:8001,112.74.98.187'. The domain name 
pr 
ovided is not valid according to RFC 1034/1035.
[10/Apr/2017 15:38:04] "GET 
/VideoParser/lYYDownloaderClientLog/?funcName=%3Cmod
 
ule%3E&lineno=26&levelname=ERROR&name=__main__&stack_info=None&args=%28%29&modul
 
e=a&pathname=C%3A%5CUsers%5Ci%5CDocuments%5CTencent+Files%5C2281570025%5CFileRec
 
v%5Ca.py&process=6636&thread=6972&created=1491838715.9931207&msecs=993.120670318
 
6035&msg=testing+remote+logging&exc_info=None&relativeCreated=64.00370597839355&
 
filename=a.py&threadName=MainThread&processName=MainProcess&levelno=40&exc_text=
 
None HTTP/1.1" 400 66752
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 138, in run
self.finish_response()
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 180, in 
finish_respo
 nse
self.write(data)
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 279, in write
self._write(data)
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 453, in _write
result = self.stdout.write(data)
  File "/usr/local/lib/python3.6/socketserver.py", line 775, in write
self._sock.sendall(b)
ConnectionResetError: [Errno 104] Connection reset by peer
[10/Apr/2017 15:38:04] "GET 
/VideoParser/lYYDownloaderClientLog/?funcName=%3Cmod
 
ule%3E&lineno=26&levelname=ERROR&name=__main__&stack_info=None&args=%28%29&modul
 
e=a&pathname=C%3A%5CUsers%5Ci%5CDocuments%5CTencent+Files%5C2281570025%5CFileRec
 
v%5Ca.py&process=6636&thread=6972&created=1491838715.9931207&msecs=993.120670318
 
6035&msg=testing+remote+logging&exc_info=None&relativeCreated=64.00370597839355&
 
filename=a.py&threadName=MainThread&processName=MainProcess&levelno=40&exc_text=
 
None HTTP/1.1" 500 59

Exception happened during processing of request from ('117.136.84.223', 49862)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 138, in run
self.finish_response()
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 180, in 
finish_respo
 nse
self.write(data)
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 279, in write
self._write(data)
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 453, in _write
result = self.stdout.write(data)
  File "/usr/local/lib/python3.6/socketserver.py", line 775, in write
self._sock.sendall(b)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 141, in run
self.handle_error()
  File 
"/usr/local/lib/python3.6/site-packages/django/core/servers/basehttp.py",   
   line 95, 
in handle_error
super(ServerHandler, self).handle_error()
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 368, in handle_error
self.finish_response()
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 180, in 
finish_respo
 nse
self.write(data)
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 274, in write
self.send_headers()
  File "/usr/local/lib/python3.6/wsgiref/han

Re: using HTTPHandler cause Django server side shows http 400 and Invalid HTTP_HOST header message

2017-04-10 Thread iMath
On Tuesday, April 11, 2017 at 12:00:27 AM UTC+8, iMath wrote:
> > Are you sure you posted the code you are actually using? Because the 
> > error message suggests a difference.
> > 
> I am sure !
> 
> As I have tested: If I pass the IP address of my web server to the host 
> parameter of HTTPHandler, the server side would show http 400 and Invalid 
> HTTP_HOST header message  ,

Besides the http 400 and Invalid HTTP_HOST header message , there are also 
exceptions , pasted here https://bpaste.net/show/f2d2e64e7a7e
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Need help with getting Key, Value out of dicts in lists

2017-04-10 Thread John Ralph
There are a number of ways to reorganise the data for the exclusive use of your 
script without affecting the original data.  Is there a reason you can't or not 
allowed to do this?

Regardless, here's some code that might make things a little easier.  It 
operates on each balancer on the fly, reduces the number of for loops, and 
eliminates worries about where the tags are placed within the list.

from operator import itemgetter

alist = \
[
[
{u'Value': 'shibboleth-prd', u'Key': 'Name'},
{u'Value': 'kvmu', u'Key': 'Billing'},
{u'Value': '20179204-181622543367489', u'Key': 'Resource_group_id'}
],
[
{u'Value': '20172857-152037106154311', u'Key': 'Resource_group_id'},
{u'Value': 'shibboleth-tst', u'Key': 'Name'}
]
]

# Problem:
# for all resource group id tags that equal '20172857-152037106154311':
#   print its name tag (eg, "shibboleth-prd-alb")

# create a container (dict) of tags for each balancer on the fly
for balancer in alist:
tags = dict(map(itemgetter('Key', 'Value'), balancer))
print 'group of tags:', tags
if itemgetter('Resource_group_id')(tags) == '20172857-152037106154311':
print '\tfound resource, resource name:', itemgetter('Name')(tags)

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installing Python 3.6.1 on a Windows 10

2017-04-10 Thread eryk sun
On Mon, Apr 10, 2017 at 3:45 PM, Colin J. Williams  wrote:
> Below is the tail of my Install Log.
> Is this a problem that I should be able to resolve?
> Advice sought.

Open a Windows / Installation issue on bugs.python.org. Zip up the
installation logs and attach the zip to the issue.
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] txkube 0.1.0

2017-04-10 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce the first release of txkube, a Twisted-based
library for interacting with Kubernetes using the HTTP API.

This release supports several of the most commonly used basic Kubernetes
objects, including Services, ConfigMaps, Deployments, ReplicaSets, and
Pods.  While Kubernetes has many, many more object kinds, this collection
of kinds already supports a very useful set of interactions.

Here is an example of txkube usage, taken from the README:

   from __future__ import print_function
   from twisted.internet.task import react

   from txkube import v1, network_kubernetes_from_context

   @react
   def main(reactor):
   k8s = network_kubernetes_from_context(reactor, u"minikube")
   client = k8s.client()
   d = client.list(v1.Namespace)
   d.addCallback(print)
   return d

You can download txkube from PyPI .
You can contribute to its development on GitHub
.

Thanks to Least Authority Enterprises  for
sponsoring this development.

Jean-Paul Calderone
http://as.ynchrono.us/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Swiss Ephemeris

2017-04-10 Thread Peter Henry
Hi Deborah,

Thanks your reply and interest,

A few years ago did create a Excel addin, that extracted planetary
coordinates from the Swisseph source code and populated excel spreadsheet
 This Marco addin had customised planetary settings of which was  useful

Currently now learning to program in Python as it  is flexible, popular
 for machine learning and data science. The idea the planetary coordinate
can help with timing stock commodity and Forex markets, as both freely
trading markets and planetary  movement adhere to natural law

Neural networks can also assist in extracting relationship information
between markets and planetary positions.

Whilst waiting for a solution  can you advise of an efficient way of
producing a a CSV file similar to the file attached, only planetary data
required


Many thanks

Peter

On 10 April 2017 at 02:52, Deborah Swanson 
wrote:

> Peter Henry wrote, on Sunday, April 09, 2017 10:53 AM
> >
> > I have a package that has been altered to imported in to
> > python, however I tired to get is working but without success
> > I be missing something obvious
> >
> > The Swiss Ephemeris enable planetary coordinate  to be
> > imported and used in your program
> >
> > Files access https://pypi.python.org/pypi/pyswisseph
> >
> > Many thanks in advance
> >
> > Peter
>
> I've also worked on the problem of getting sweph into Python and have
> mostly struck out so far myself.
>
> I found one reliable means to get sweph's planetary data into Python,
> but it's more or less a cheat. Nonetheless, if you want to see how much
> good it does you, try the Swiss Ephemeris Test Page at
> http://www.astro.com/swisseph/swetest.htm. If you can successfully
> formulate a query useful to your purposes, you can download a csv of
> results, read it into Python, and work from there. Right now I'm working
> on converting some Excel spreadsheets and Excel VBA I use into Python
> and recoding it all, using the CSVs for jumping off points. That works
> pretty well, except the times from swetest are off a bit and I haven't
> figured out why. But I'm concentrating on getting all my VBA code ported
> to Python, and will go back to getting bang on data from sweph after I
> have my code done.
>
> The first thing I tried was to get sweph's C source code into a free
> IDE, but that whole project went down in flames. You can read bits and
> pieces of that misadventure at the tail end of the "Python application
> launcher (for Python code)" thread. I found sweph's C source code at
> some link off "Programming interface to the Swiss Ephemeris" at
> http://www.astro.com/swisseph/swephprg.htm (or maybe it was on
> http://www.astro.com/swisseph/swephinfo_e.htm - I can't easily find it
> now, but the download link is in one of those two pages somewhere.)
>
> Then I tried picking through sweph's C source code, attempting to
> manually reproduce the logic and the calculations in Python. That was a
> highly qualified semi-success because the times were still off, but it
> essentially produces the most basic planetary data. The swetest output
> CSVs were more complete however, and easy to read the planetary data
> into Python from, so I'd pretty much abandoned efforts to "translate"
> the C source code. And now, all my efforts to leverage the C source
> code. Even if successful it would be a lot more time sunk into working
> with a language other than Python, which I likely wouldn't have a use
> for after this project is completed.
>
> However, I have seen bits here and there on this list that are at least
> interesting. Tim Chase mentioned in passing that he encapsulated C
> source code in a class, which may bear looking into. Lutz Horn also gave
> a link for building a Python module to add a C language library to
> Python, which also might be worth checking out:
> https://docs.python.org/3/extending/index.html (I changed the 2 to a 3
> from the link he gave, but you can change it back to 2 if your working
> in a build of Python 2.)
>
> But many thanks for your pypi link to pyswisseph, which I will check
> out. I can reply to this thread after I give it a shot and tell you what
> I think of it. But like I said earlier, that won't be until all my Excel
> VBA code, which jumps off from the sweph bare planetary data, is ported
> to Python and working. Could be awhile yet. And if pyswisseph doesn't
> pan out, I'll likely work on refining the two methods I have for
> producing the planetary data, both of which are only lacking precisely
> accurate time data in my local time, and both are off by only 5-30
> minutes. I easily limped along for years with my Excel spread sheets
> using the swetest CSVs for input, even though my times then were more
> than a day off.
>
> Good luck! (and this venture is a goodly portion of luck...)
>
> Deborah
>
> PS. I've been using medical astrology to look ahead at my medical
> condition for years in advance. And being off by a day or so doesn't
> matter that much when you're looking at trends over t

how to convert this container back to format build result?

2017-04-10 Thread Ho Yeung Lee

http://construct.readthedocs.io/en/latest/basics.html

format.build can build the hex string, 
but after edit attribute of the format parse result
it is a container, how to convert this container back to format build result?

#format.parse(format.build(dict(width=3,height=2,pixels=[7,8,9,11,12,13]))).signature
format = Struct(
"signature" / Const(b"a2MP"),
"width" / Int8ub,
"height" / Int8ub,
"pixels" / Array(3 * 2, Byte),
)

#protocolA = {"a1" : "a2"}
#protocolA["a2"] = "a3"
#protocolA["a3"] = "a1"
protocolA = {"a1MP" : 
format.build(dict(width=3,height=2,pixels=[7,8,9,11,12,13]))}

a2MP = 
format.parse(format.build(dict(width=3,height=2,pixels=[7,8,9,11,12,13])))
a2MP.signature = "a3MP"
protocolA["a2MP"] = a2MP.build({})
a1MP = 
format.parse(format.build(dict(width=3,height=2,pixels=[7,8,9,11,12,13])))
a1MP.signature = "a1MP"
protocolA["a3MP"] = format.build(a1MP)
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Swiss Ephemeris

2017-04-10 Thread Deborah Swanson
Hi Peter,

I would be interested in seeing your Excel addin with customized
planetary settings. I'd be curious what these customizations would be,
though if they look useful I'd more likely be scavenging the code to
rewrite it in Python and add to what I already have, rather than using
the addin in Excel. The only thing not quite right about what I have is
the times, which are a smidge off. This could be due to planetary
anomalies, so I definitely would like to look at it.

I totally agree with all you said about Python and more. I didn't start
out in Python looking to replace Excel or to migrate my planetary
project to it, those things just happened along the way. But looking
around to see what was new and what was better than anything I'd done
before, Python was a natural choice.

I'll have to say though that I don't share your enthusiasm for modeling
the market with planetary relationships, indeed any mathematical
modelling of the market can easily be overall wrong, and yet complex
enough to engage the explorer endlessly. 

I've analyzed a couple of these schemes to draw that conclusion, though
it's tentative at best. Obviously there are mathematical models of the
market that do work, but I really don't know anything about them. 

In this case though, I don't see the connection between planetary
configurations and a pure physical aspect of the market for them to
engage with. And as you may recall from somewhere, to establish
causality you must produce the causal link between the two sets of
events you're attempting to correlate. No matter how stunning an array
of coincidences might be, without producing the causal link you really
don't have anything. This is a key error that many who do statistical
analyses tend to overlook.

I looked at your CSV, but I'm not sure what you would like to add to it,
probably because I'm totally unfamiliar with this type of project. 

Best in your endeavors,

Deborah


Peter Henry wrote, on Monday, April 10, 2017 11:58 AM

Hi Deborah,


Thanks your reply and interest, 


A few years ago did create a Excel addin, that extracted planetary
coordinates from the Swisseph source code and populated excel
spreadsheet  This Marco addin had customized planetary settings of which
was  useful


Currently now learning to program in Python as it  is flexible, popular
for machine learning and data science. The idea the planetary coordinate
can help with timing stock commodity and Forex markets, as both freely
trading markets and planetary  movement adhere to natural law


Neural networks can also assist in extracting relationship information
between markets and planetary positions. 


Whilst waiting for a solution  can you advise of an efficient way of
producing a a CSV file similar to the file attached, only planetary data
required




Many thanks 


Peter 


On 10 April 2017 at 02:52, Deborah Swanson 
wrote:

Peter Henry wrote, on Sunday, April 09, 2017 10:53 AM
>
> I have a package that has been altered to imported in to
> python, however I tired to get is working but without success
> I be missing something obvious
>
> The Swiss Ephemeris enable planetary coordinate  to be
> imported and used in your program
>
> Files access https://pypi.python.org/pypi/pyswisseph
>
> Many thanks in advance
>
> Peter

I've also worked on the problem of getting sweph into Python and have
mostly struck out so far myself.

I found one reliable means to get sweph's planetary data into Python,
but it's more or less a cheat. Nonetheless, if you want to see how much
good it does you, try the Swiss Ephemeris Test Page at
http://www.astro.com/swisseph/swetest.htm. If you can successfully
formulate a query useful to your purposes, you can download a csv of
results, read it into Python, and work from there. Right now I'm working
on converting some Excel spreadsheets and Excel VBA I use into Python
and recoding it all, using the CSVs for jumping off points. That works
pretty well, except the times from swetest are off a bit and I haven't
figured out why. But I'm concentrating on getting all my VBA code ported
to Python, and will go back to getting bang on data from sweph after I
have my code done.

The first thing I tried was to get sweph's C source code into a free
IDE, but that whole project went down in flames. You can read bits and
pieces of that misadventure at the tail end of the "Python application
launcher (for Python code)" thread. I found sweph's C source code at
some link off "Programming interface to the Swiss Ephemeris" at
http://www.astro.com/swisseph/swephprg.htm (or maybe it was on
http://www.astro.com/swisseph/swephinfo_e.htm - I can't easily find it
now, but the download link is in one of those two pages somewhere.)

Then I tried picking through sweph's C source code, attempting to
manually reproduce the logic and the calculations in Python. That was a
highly qualified semi-success because the times were still off, but it
essentially produces the most basic planetary data. The swetest output
CS

Fwd: Swiss Ephemeris

2017-04-10 Thread Peter Henry
Hi Deborah

Very few people would believe there is correlation between planetary cycles
and the stockmarket  however this is known to select few, for many years, I
can also visually see relationship on charts, however its hard to quantify
statically

http://astrologynewsservice.com/business/study-confirms-plan
ets-impact-stock-market-averages/

I'll forward the Excel addin later it works on Windows 7 and require
updating to Win10

The idea is to create a full and complete program in Python only, that
would import stock data, generate planetary coordinates, pre process train
then predict

I'll keep you updated

Peter



On 10 Apr 2017 9:10 p.m., "Deborah Swanson" 
wrote:

> Hi Peter,
>
> I would be interested in seeing your Excel addin with customized
> planetary settings. I'd be curious what these customizations would be,
> though if they look useful I'd more likely be scavenging the code to
> rewrite it in Python and add to what I already have, rather than using
> the addin in Excel. The only thing not quite right about what I have is
> the times, which are a smidge off. This could be due to planetary
> anomalies, so I definitely would like to look at it.
>
> I totally agree with all you said about Python and more. I didn't start
> out in Python looking to replace Excel or to migrate my planetary
> project to it, those things just happened along the way. But looking
> around to see what was new and what was better than anything I'd done
> before, Python was a natural choice.
>
> I'll have to say though that I don't share your enthusiasm for modeling
> the market with planetary relationships, indeed any mathematical
> modelling of the market can easily be overall wrong, and yet complex
> enough to engage the explorer endlessly.
>
> I've analyzed a couple of these schemes to draw that conclusion, though
> it's tentative at best. Obviously there are mathematical models of the
> market that do work, but I really don't know anything about them.
>
> In this case though, I don't see the connection between planetary
> configurations and a pure physical aspect of the market for them to
> engage with. And as you may recall from somewhere, to establish
> causality you must produce the causal link between the two sets of
> events you're attempting to correlate. No matter how stunning an array
> of coincidences might be, without producing the causal link you really
> don't have anything. This is a key error that many who do statistical
> analyses tend to overlook.
>
> I looked at your CSV, but I'm not sure what you would like to add to it,
> probably because I'm totally unfamiliar with this type of project.
>
> Best in your endeavors,
>
> Deborah
>
>
> Peter Henry wrote, on Monday, April 10, 2017 11:58 AM
>
> Hi Deborah,
>
>
> Thanks your reply and interest,
>
>
> A few years ago did create a Excel addin, that extracted planetary
> coordinates from the Swisseph source code and populated excel
> spreadsheet  This Marco addin had customized planetary settings of which
> was  useful
>
>
> Currently now learning to program in Python as it  is flexible, popular
> for machine learning and data science. The idea the planetary coordinate
> can help with timing stock commodity and Forex markets, as both freely
> trading markets and planetary  movement adhere to natural law
>
>
> Neural networks can also assist in extracting relationship information
> between markets and planetary positions.
>
>
> Whilst waiting for a solution  can you advise of an efficient way of
> producing a a CSV file similar to the file attached, only planetary data
> required
>
>
>
>
> Many thanks
>
>
> Peter
>
>
> On 10 April 2017 at 02:52, Deborah Swanson 
> wrote:
>
> Peter Henry wrote, on Sunday, April 09, 2017 10:53 AM
> >
> > I have a package that has been altered to imported in to
> > python, however I tired to get is working but without success
> > I be missing something obvious
> >
> > The Swiss Ephemeris enable planetary coordinate  to be
> > imported and used in your program
> >
> > Files access https://pypi.python.org/pypi/pyswisseph
> >
> > Many thanks in advance
> >
> > Peter
>
> I've also worked on the problem of getting sweph into Python and have
> mostly struck out so far myself.
>
> I found one reliable means to get sweph's planetary data into Python,
> but it's more or less a cheat. Nonetheless, if you want to see how much
> good it does you, try the Swiss Ephemeris Test Page at
> http://www.astro.com/swisseph/swetest.htm. If you can successfully
> formulate a query useful to your purposes, you can download a csv of
> results, read it into Python, and work from there. Right now I'm working
> on converting some Excel spreadsheets and Excel VBA I use into Python
> and recoding it all, using the CSVs for jumping off points. That works
> pretty well, except the times from swetest are off a bit and I haven't
> figured out why. But I'm concentrating on getting all my VBA code ported
> to Python, and will go back to getting bang on data from 

RE: Swiss Ephemeris

2017-04-10 Thread Deborah Swanson
Hi Peter

I'm willing to believe there's a correlation between planetary cycles
and the stockmarket, if you say you see one. The question is whether
this correlation has truth value significance, or whether it's just a
set of coincidences. 

The correlation is interesting, but I fail to see the causal link, the
reason why planetary cycles necessarily have a relationship with market
movements, and without that all you have is coincidence. 

Though one could spend a great deal of time analyzing the correlation, I
have low confidence that it would be a strong and reliable correlation.
This has been the fate of many other misadventures in astrology, systems
of belief built around weak and unreliable correlations that are
sometimes right, but more often wrong, sad to say.

I don't have Windows 7 or 10. Any chance there's source code for the
addin? That's what I would be looking at anyway. ;)

Best,
Deborah



Peter Henry wrote, on Monday, April 10, 2017 1:56 PM
> 
> Hi Deborah
> 
> Very few people would believe there is correlation between 
> planetary cycles and the stockmarket  however this is known 
> to select few, for many years, I can also visually see 
> relationship on charts, however its hard to quantify statically
> 
> http://astrologynewsservice.com/business/study-confirms-plan
> ets-impact-stock-market-averages/
> 
> I'll forward the Excel addin later it works on Windows 7 and 
> require updating to Win10
> 
> The idea is to create a full and complete program in Python 
> only, that would import stock data, generate planetary 
> coordinates, pre process train then predict
> 
> I'll keep you updated
> 
> Peter
> 
> 
> 
> On 10 Apr 2017 9:10 p.m., "Deborah Swanson" 
> 
> wrote:
> 
> > Hi Peter,
> >
> > I would be interested in seeing your Excel addin with customized 
> > planetary settings. I'd be curious what these 
> customizations would be, 
> > though if they look useful I'd more likely be scavenging 
> the code to 
> > rewrite it in Python and add to what I already have, rather 
> than using 
> > the addin in Excel. The only thing not quite right about 
> what I have 
> > is the times, which are a smidge off. This could be due to 
> planetary 
> > anomalies, so I definitely would like to look at it.
> >
> > I totally agree with all you said about Python and more. I didn't 
> > start out in Python looking to replace Excel or to migrate my 
> > planetary project to it, those things just happened along 
> the way. But 
> > looking around to see what was new and what was better than 
> anything 
> > I'd done before, Python was a natural choice.
> >
> > I'll have to say though that I don't share your enthusiasm for 
> > modeling the market with planetary relationships, indeed any 
> > mathematical modelling of the market can easily be overall 
> wrong, and 
> > yet complex enough to engage the explorer endlessly.
> >
> > I've analyzed a couple of these schemes to draw that conclusion, 
> > though it's tentative at best. Obviously there are 
> mathematical models 
> > of the market that do work, but I really don't know anything about 
> > them.
> >
> > In this case though, I don't see the connection between planetary 
> > configurations and a pure physical aspect of the market for them to 
> > engage with. And as you may recall from somewhere, to establish 
> > causality you must produce the causal link between the two sets of 
> > events you're attempting to correlate. No matter how 
> stunning an array 
> > of coincidences might be, without producing the causal link 
> you really 
> > don't have anything. This is a key error that many who do 
> statistical 
> > analyses tend to overlook.
> >
> > I looked at your CSV, but I'm not sure what you would like 
> to add to 
> > it, probably because I'm totally unfamiliar with this type 
> of project.
> >
> > Best in your endeavors,
> >
> > Deborah
> >
> >
> > Peter Henry wrote, on Monday, April 10, 2017 11:58 AM
> >
> > Hi Deborah,
> >
> >
> > Thanks your reply and interest,
> >
> >
> > A few years ago did create a Excel addin, that extracted planetary 
> > coordinates from the Swisseph source code and populated excel 
> > spreadsheet  This Marco addin had customized planetary settings of 
> > which was  useful
> >
> >
> > Currently now learning to program in Python as it  is flexible, 
> > popular for machine learning and data science. The idea the 
> planetary 
> > coordinate can help with timing stock commodity and Forex 
> markets, as 
> > both freely trading markets and planetary  movement adhere 
> to natural 
> > law
> >
> >
> > Neural networks can also assist in extracting relationship 
> information 
> > between markets and planetary positions.
> >
> >
> > Whilst waiting for a solution  can you advise of an 
> efficient way of 
> > producing a a CSV file similar to the file attached, only planetary 
> > data required
> >
> >
> >
> >
> > Many thanks
> >
> >
> > Peter
> >
> >
> > On 10 April 2017 at 02:52, Deborah Swanson 
> 
> > wrote:
> >
> > Peter

Re: read in a list in a file to list

2017-04-10 Thread Erik

On 09/04/17 22:22, john polo wrote:

The new attempt gives me a list, now I have to figure out how to deal
with unwanted quotation marks and spaces.

datFil =  open("apelist.txt")
datObj =  datFil.read()


datObj2 = datObj.replace('" ','')  #added this comment while writing
this email: I guess I could have used 'datObj = datFil.read().replace('"
','')'. Can you make two replacements in the same statement, for example
'datObj=datFil.read().replace('" ','').replace('"','')?

datObj2 = datObj2.replace('"','')  #this was here to try to get rid of "
that didn't have a subsequent space.


John, where does your "apelist.txt" file come from? Who has decided what 
format it should be in?


If *you* get to decide that, then the best thing to do is to specify a 
format that is easy to read in in the first place - rather than 
specifying something that looks like source code and then has to be parsed.


E.g., if the file had the format:

Home sapiens
Pan troglodytes
Gorilla gorilla

(i.e., each value on a separate line with no quotes or any other 
"noise"), then the code to read that in as you have indicated you want 
is something like:


for i in open("apefile.txt").readlines():
print("one of the apes is " + i.rstrip())

(the .rstrip() is to remove the trailing newline character - and any 
other trailing whitespace - which readlines() will include in what it 
returns).


Of course, if you don't have any control over the input file's format, 
then it looks like you (or something you delegate to) will have to do 
some sort of parsing.


E.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python and the need for speed

2017-04-10 Thread Erik

On 10/04/17 03:23, Chris Angelico wrote:

Okay, I have a pretty thick skin, but this is getting a bit obnoxious.
Can you PLEASE post something that isn't just insulting me? Thanks.


Are you suggesting he should post something that insults you *and* 
others? If so, I'm up for being insulted too ;)


E.

--
https://mail.python.org/mailman/listinfo/python-list


Re: Python and the need for speed

2017-04-10 Thread Chris Angelico
On Tue, Apr 11, 2017 at 8:45 AM, Erik  wrote:
> On 10/04/17 03:23, Chris Angelico wrote:
>>
>> Okay, I have a pretty thick skin, but this is getting a bit obnoxious.
>> Can you PLEASE post something that isn't just insulting me? Thanks.
>
>
> Are you suggesting he should post something that insults you *and* others?
> If so, I'm up for being insulted too ;)

If he does, it might be the final thing that gets him banned from the
mailing list.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pound sign problem

2017-04-10 Thread Steve D'Aprano
On Tue, 11 Apr 2017 12:50 am, Lew Pitcher wrote:

> David Shi wrote:
> 
>> In the data set, pound sign escape appears:
>> u'price_currency': u'\xa3', u'price_formatted': u'\xa3525,000',

That looks like David is using Python 2.

>> When using table.to_csv after importing pandas as pd, an error message
>> persists as follows: UnicodeEncodeError: 'ascii' codec can't encode
>> character u'\xa3' in position 0: ordinal not in range(128)
> 
> There is no "pound sign" in ASCII[1]. Try changing your target encoding to
> something other than ASCII.

Please don't encourage the use of old legacy encodings.

In 2017, unless you are reading from old legacy files created using a
non-Unicode encoding, you should just use UTF-8.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and the need for speed

2017-04-10 Thread Christian Gollwitzer

Am 10.04.17 um 02:21 schrieb Gregory Ewing:

Heck, you can write an exec() function for C if you really
want. Run the C compiler in another process, dynamically
load the object file and call it. Doing that would be very
inefficient, but it wouldn't slow down the rest of your
C code.


Actually, this thing exists and it is quite useful. tcc can be used as a 
library / JIT compiler for C. It does allow both writing to a dynamic 
library as well as creating callable functions in memory.


https://github.com/LuaDist/tcc/blob/master/libtcc.h#L64

What you can't do with it, however, is access to local variables. i.e. 
writing an exec which does this:


int i=0;
exec("i = 5");
printf("%d", i); // prints 5

is impossible in C, and making it possible (via debug symbols, e.g.) 
would make the program slower, because C compilers reorder the 
instructions and assign variables to registers.


Christian

--
https://mail.python.org/mailman/listinfo/python-list


Re: Swiss Ephemeris

2017-04-10 Thread Rustom Mody
On Monday, April 10, 2017 at 11:26:47 AM UTC+5:30, Deborah Swanson wrote:
> The great ancients were no less endowed with intelligence than we are, they
> simply directed it to different ends.

And just when I was convinced by the all-knowers that my gpa was a monkey
you've spoilt my complacence

> ... medical astrology...

whether that is hooey or scepticism of it is hooey, I dont know
[Yeah I genuinely don't know what that term means for you]

However you may be interested in
http://blog.languager.org/2016/01/how-long.html
which is a motley collection of the incredible persistence of humans to
erroneous ways and outlooks and their damaging consequences

[Frank Admission: That list started with a discussion on this list where I 
suggested that OOP is already debunked hooey and that FP is the way forward
for programming.
To which Steven asked that since FP is at least 50 years old and has not got 
very far, what makes one think its going anywhere...
To which I wondered... Is 50 years a long time? By what standard? 
Hence that list
]
-- 
https://mail.python.org/mailman/listinfo/python-list