How to find number of whole weeks between dates?

2015-06-10 Thread Sebastian M Cheung via Python-list
Say in 2014 April to May whole weeks would be 7th, 14th 28th April and  May 
would be 5th, 12th and 19th. So expecting 7 whole weeks in total
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to find number of whole weeks between dates?

2015-06-10 Thread Sebastian M Cheung via Python-list
On Wednesday, June 10, 2015 at 6:06:09 PM UTC+1, Sebastian M Cheung wrote:
> Say in 2014 April to May whole weeks would be 7th, 14th 28th April and  May 
> would be 5th, 12th and 19th. So expecting 7 whole weeks in total

What I mean is given two dates I want to find WHOLE weeks, so if given the 2014 
calendar and function has two inputs (4th and 5th month) then 7th, 14th, 21st 
and 28th from April with 28th April week carrying into May, and then 5th, 12th 
and 19th May to give total of 7 whole weeks, because 26th May is not a whole 
week and will not be counted.

Hope thats clear.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to find number of whole weeks between dates?

2015-06-10 Thread Sebastian M Cheung via Python-list
yes just whole weeks given any two months, I did looked into calendar module 
but couldn't find specifically what i need.
-- 
https://mail.python.org/mailman/listinfo/python-list


How to pretty mathematical formulas in Python? Similar to Mathematica formats.

2015-06-11 Thread Sebastian M Cheung via Python-list
How to pretty mathematical formulas in Python? Similar to Mathematica formats.

Are there good packages to prettify mathematica formulas in Python?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to pretty mathematical formulas in Python? Similar to Mathematica formats.

2015-06-11 Thread Sebastian M Cheung via Python-list
On Thursday, June 11, 2015 at 7:33:12 PM UTC+1, Sebastian M Cheung wrote:
> How to pretty mathematical formulas in Python? Similar to Mathematica formats.
> 
> Are there good packages to prettify mathematica formulas in Python?

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


XCode and Python

2015-06-11 Thread Sebastian M Cheung via Python-list
For some reason I cannot build now in XCode:

$ xcodebuild -find python
/Users/sebc/anaconda/bin/python

$python
Python 2.7.10 |Anaconda 2.2.0 (x86_64)| (default, May 28 2015, 17:04:42) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org

But XCode now simply say error

env: python: No such file or directory
Command 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 failed with exit code 127

I couldn't find anything relating XCode for iPhone related to Python build? I 
am using
anaconda Python

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


Re: XCode and Python

2015-06-11 Thread Sebastian M Cheung via Python-list
On Thursday, June 11, 2015 at 11:07:59 PM UTC+1, Sebastian M Cheung wrote:
> For some reason I cannot build now in XCode:
> 
> $ xcodebuild -find python
> /Users/sebc/anaconda/bin/python
> 
> $python
> Python 2.7.10 |Anaconda 2.2.0 (x86_64)| (default, May 28 2015, 17:04:42) 
> [GCC 4.2.1 (Apple Inc. build 5577)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> Anaconda is brought to you by Continuum Analytics.
> Please check out: http://continuum.io/thanks and https://binstar.org
> 
> But XCode now simply say error
> 
> env: python: No such file or directory
> Command 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
>  failed with exit code 127
> 
> I couldn't find anything relating XCode for iPhone related to Python build? I 
> am using
> anaconda Python
> 
> Anyone?

Or I need to configure something in Xcode?
-- 
https://mail.python.org/mailman/listinfo/python-list


Java to Python autoconverters

2015-06-12 Thread Sebastian M Cheung via Python-list
Are these available? Any good ones to recommend?
-- 
https://mail.python.org/mailman/listinfo/python-list


python financial data cleaning

2015-06-15 Thread Sebastian M Cheung via Python-list
How to do financial data cleaning ? Say I assume a list of 1000 finance series 
data in myList = Open, High, Low and Close. For missing Close Price data, What 
is best practice to clean data in Python

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


Re: python financial data cleaning

2015-06-15 Thread Sebastian M Cheung via Python-list
On Monday, June 15, 2015 at 11:13:07 AM UTC+1, Sebastian M Cheung wrote:
> How to do financial data cleaning ? Say I assume a list of 1000 finance 
> series data in myList = Open, High, Low and Close. For missing Close Price 
> data, What is best practice to clean data in Python

Thanks Mark just looking into Pandas now



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


Re: python financial data cleaning

2015-06-15 Thread Sebastian M Cheung via Python-list
On Monday, June 15, 2015 at 12:35:18 PM UTC+1, Laura Creighton wrote:
> I don't know anything about this program, and in particular how
> complete it is, but worth a look
> https://github.com/benjaminmgross/clean-fin-data
> 
> Laura

Thanks Laura, I will check it out, but basically it is to clean financial 
series data as sometimes there are missing closing price data, misalignment of 
some sort etc 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python financial data cleaning

2015-06-15 Thread Sebastian M Cheung via Python-list
On Monday, June 15, 2015 at 11:19:48 AM UTC+1, Mark Lawrence wrote:
> On 15/06/2015 11:12, Sebastian M Cheung via Python-list wrote:
> > How to do financial data cleaning ? Say I assume a list of 1000 finance 
> > series data in myList = Open, High, Low and Close. For missing Close Price 
> > data, What is best practice to clean data in Python
> >
> 
> http://pandas.pydata.org/
> 
> -- 
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
> 
> Mark Lawrence


Hi Mark,

Below I read in DirtyData (financial data) from Excel and then find the number 
of NaN missing Closed Pricing data:

xls = pd.ExcelFile('DirtyData.xlsm')
df = xls.parse('Dirty Data', index_col=None, na_values=['NA'])
print(df.isnull().astype(int).sum()) 

So if I were to clean missing Open Price data, I could copy from previous or 
row's Close Price data, but how would I implement it? Thanks

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


anaconda upgrade

2015-06-17 Thread Sebastian M Cheung via Python-list
What is the best way to upgrade an existing virtual environment anaconda from 
2.7.9 to 2.7.10
-- 
https://mail.python.org/mailman/listinfo/python-list