From edilson.floriano at gmail.com Wed Apr 27 09:14:39 2016 From: edilson.floriano at gmail.com (Edilson Santos) Date: Wed, 27 Apr 2016 10:14:39 -0300 Subject: [DB-SIG] numbers with correct decimals places Message-ID: Hi, I'm using a Michael Halls-Moore's source code, posted on https://www.quantstart.com/articles/Forecasting-Financial-Time-Series-Part-1 The original code import the Yahoo's data, using a user-defined function. This function imports the data set with the correct number of decimal places. I've made a modification to import *.csv files, eliminating the function definition. The problem is that imported file comes with only two decimal places, even if the original file (*.csv) presents six decimal places. How can I get a DataFrame with correct decimal places? /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #Location=r'C:\Users\...\XXXX.csv' Location = r'C:\Users\.....\XXXX.csv' #Access Data set ts = pd.DataFrame.from_csv(Location,header=0,sep=',',index_col=1,parse_dates=True, encoding=None,tupleize_cols=False,infer_datetime_format=False) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Best Regards Edilson -------------- next part -------------- An HTML attachment was scrubbed... URL: From mal at egenix.com Thu Apr 28 07:52:49 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 28 Apr 2016 13:52:49 +0200 Subject: [DB-SIG] numbers with correct decimals places In-Reply-To: References: Message-ID: <5721F991.3080704@egenix.com> On 27.04.2016 15:14, Edilson Santos wrote: > Hi, > I'm using a Michael Halls-Moore's source code, posted on > https://www.quantstart.com/articles/Forecasting-Financial-Time-Series-Part-1 > The original code import the Yahoo's data, using a user-defined function. > This function imports the data set with the correct number of decimal > places. > I've made a modification to import *.csv files, eliminating the function > definition. > The problem is that imported file comes with only two decimal places, even > if the original file (*.csv) presents six decimal places. > How can I get a DataFrame with correct decimal places? This SIG is about relational databases, so I think you'd be better off asking in a pandas related forum for help. Something you might want to try is use the stdlib csv module for the import and then pass the resulting list to pandas. > /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// > #Location=r'C:\Users\...\XXXX.csv' > Location = r'C:\Users\.....\XXXX.csv' > #Access Data set > ts = > pd.DataFrame.from_csv(Location,header=0,sep=',',index_col=1,parse_dates=True, > encoding=None,tupleize_cols=False,infer_datetime_format=False) > //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// > > Best Regards > > Edilson > > > > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > https://mail.python.org/mailman/listinfo/db-sig > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Apr 28 2016) >>> Python Projects, Coaching and Consulting ... http://www.egenix.com/ >>> Python Database Interfaces ... http://products.egenix.com/ >>> Plone/Zope Database Interfaces ... http://zope.egenix.com/ ________________________________________________________________________ ::: We implement business ideas - efficiently in both time and costs ::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ http://www.malemburg.com/