Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92643

Re: python financial data cleaning

Newsgroups comp.lang.python
Date 2015-06-15 14:01 -0700
References <b0cbc75c-cc0b-4f27-a8d6-e4c20c356e6d@googlegroups.com> <mailman.480.1434363576.13271.python-list@python.org>
Message-ID <55a0ccda-572c-4324-9169-08028d4fb619@googlegroups.com> (permalink)
Subject Re: python financial data cleaning
From Sebastian M Cheung <minscheung@googlemail.com>

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

python financial data cleaning Sebastian M Cheung <minscheung@googlemail.com> - 2015-06-15 03:12 -0700
  Re: python financial data cleaning Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-15 11:19 +0100
    Re: python financial data cleaning Sebastian M Cheung <minscheung@googlemail.com> - 2015-06-15 14:01 -0700
      Re: python financial data cleaning Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-16 20:40 +0100
  Re: python financial data cleaning Sebastian M Cheung <minscheung@googlemail.com> - 2015-06-15 03:59 -0700
  Re: python financial data cleaning Laura Creighton <lac@openend.se> - 2015-06-15 13:34 +0200
    Re: python financial data cleaning Sebastian M Cheung <minscheung@googlemail.com> - 2015-06-15 06:42 -0700

csiph-web