dataset

How to delete the first row of a dataframe in R?

和自甴很熟 提交于 2019-12-17 08:17:14
问题 I have a dataset with 11 columns with over a 1000 rows each. The columns were labeled V1, V2, V11, etc.. I replaced the names with something more useful to me using the "c" command. I didn't realize that row 1 also contained labels for each column and my actual data starts on row 2. Is there a way to delete row 1 and decrement? 回答1: Keep the labels from your original file like this: df = read.table('data.txt', header = T) If you have columns named x and y, you can address them like this: df$x

Direct method from SQL command text to DataSet

こ雲淡風輕ζ 提交于 2019-12-17 07:27:12
问题 What is the most direct route to get a DataSet if I have a sql command? string sqlCommand = "SELECT * FROM TABLE"; string connectionString = "blahblah"; DataSet = GetDataSet(sqlCommand,connectionString); GetDataSet() { //...? } I started with SqlConnection and SqlCommand , but the closest thing I see in the API is SqlCommand.ExecuteReader() . With this method, I'll need to get a SqlDataReader and then convert this to a DataSet manually. I figure there is a more direct route to accomplish the

How do I import from Excel to a DataSet using Microsoft.Office.Interop.Excel?

北慕城南 提交于 2019-12-17 06:26:33
问题 What I want to do I'm trying to use the Microsoft.Office.Interop.Excel namespace to open an Excel file (XSL or CSV, but sadly not XSLX) and import it into a DataSet. I don't have control over the worksheet or column names, so I need to allow for changes to them. What I've tried I've tried the OLEDB method of this in the past, and had a lot of problems with it (buggy, slow, and required prior knowledge of the Excel file's schema), so I want to avoid doing that again. What I'd like to do is use

How to bind crystal report to manually created DataSet

家住魔仙堡 提交于 2019-12-17 04:33:51
问题 I wan't to create DataSet from code and set it as data source for crystal report. I don't want to create a DataSet xsd file in VS if I don't have to. Just pure code. DataSet ds = new DataSet(); DataTable tbl = new DataTable(); DataColumn cln = new DataColumn(); // I fill row, columns, table and add it to ds object ... Then when I need report I use: myReport.SetDataSource(ds); The problem here is I don't know how to bind this to report? How to add fields? I have a text and binary data (image).

Optimal HDF5 dataset chunk shape for reading rows

不羁的心 提交于 2019-12-17 02:49:18
问题 I have a reasonable size (18GB compressed) HDF5 dataset and am looking to optimize reading rows for speed. Shape is (639038, 10000). I will be reading a selection of rows (say ~1000 rows) many times, located across the dataset. So I can't use x:(x+1000) to slice rows. Reading rows from out-of-memory HDF5 is already slow using h5py since I have to pass a sorted list and resort to fancy indexing. Is there a way to avoid fancy indexing, or is there a better chunk shape/size I can use? I have

Dataset from database is empty

我是研究僧i 提交于 2019-12-16 18:03:37
问题 I'm accessing a table from my database. I have added the tables as a dataset in Visual Studio 2013, but when I try to use it, it comes out empty. This is what I'm trying to do: IQueryable<NorthwindDataSet.OrdersRow> LookupOrdersForYear(int year) { using (var context = new NorthwindDataSet()) { var orders = from order in context.Orders where order.OrderDate != null && order.OrderDate.Year >= year select order; return orders.ToList().AsQueryable(); } } I found out that orders was empty, so I

Import Excel to DataTable string's are empty

白昼怎懂夜的黑 提交于 2019-12-14 03:58:25
问题 To import excel to datatable, I am using the simple code: string connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0; data source={0}; Extended Properties=Excel 12.0;", physicalFolder + FileUpload1.FileName); OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", connectionString); DataSet ds = new DataSet(); When in one of the rows of excel, if my row looks like below strings are ommited and my data set looks like this However if I add some strings and if

Perl: Programming Efficiency when computing correlation coefficients for a large set of data

删除回忆录丶 提交于 2019-12-14 03:49:15
问题 EDIT: Link should work now, sorry for the trouble I have a text file that looks like this: Name, Test 1, Test 2, Test 3, Test 4, Test 5 Bob, 86, 83, 86, 80, 23 Alice, 38, 90, 100, 53, 32 Jill, 49, 53, 63, 43, 23. I am writing a program that given this text file, it will generate a Pearson's correlation coefficient table that looks like this where the entry (x,y) is the correlation between person x and person y: Name,Bob,Alice,Jill Bob, 1, 0.567088412588577, 0.899798494392584 Alice, 0

DataSets to POCOs - an inquiry regarding DAL architecture

走远了吗. 提交于 2019-12-14 03:46:27
问题 I have to develop a fairly large ASP.NET MVC project very quickly and I would like to get some opinions on my DAL design to make sure nothing will come back to bite me since the BL is likely to get pretty complex. A bit of background: I am working with an Oracle backend so the built-in LINQ to SQL is out; I also need to use production-level libraries so the Oracle EF provider project is out; finally, I am unable to use any GPL or LGPL code (Apache, MS-PL, BSD are okay) so NHibernate/Castle

ASP.NET MVC - System.Data.DataSet not referenced problem

﹥>﹥吖頭↗ 提交于 2019-12-14 02:43:54
问题 Well, first of all sorry about this question it must be pretty straight forward for you guys but I'm struggling myself on it, and I need to make it work :( Well I'm trying t o use DataSet on my application and when I render it I got: The type 'System.Data.DataSet' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data in my application System.Data is already being referenced from C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll and I'm