dataset

Read gml file in R

假装没事ソ 提交于 2019-12-11 06:17:42
问题 i have problem when i try to read a gml file of political books dataset. i use the command: hh=read.table("polbooks.gml") Erreur dans scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : la ligne 2 n'avait pas 2 éléments and when i use this one: library(multiplex) hh=read.gml("polbooks.gml") Erreur dans (grep("graphics", edg, fixed = TRUE)[(i - 1)] + 2):(grep("graphics", : argument NA / NaN i have this problem in every dataset ".gml" 回答1: you can do like this, g<-read.graph(

D3 js get a d3.max from an object that contains a specific key value

廉价感情. 提交于 2019-12-11 06:15:18
问题 I have the following dataset and am trying to get the d3.max to specify a domain for a scale, but want the d3.max value only from objects that have the key enabled=true. How can this be achieved? [{ "key": "name1", "enabled": "true", "values": [{ "date": "2016-09-13T02:11:44Z", "value": "100", }, { "date": "2016-09-13T02:11:44Z", "value": "200", }] }, { "key": "name2", "enabled": "false", "values": [{ "date": "2016-09-13T02:11:44Z", "value": "400", }, { "date": "2016-09-13T02:11:44Z", "value"

Process to convert TObjectlist to TObjectList<T> to use in TObjectDataset

我的未来我决定 提交于 2019-12-11 06:08:42
问题 I would like to use TObjectDataset which relies on TObjectList<> (System.Generics.Collections / Spring.Collections) but only have a TObjectList (System.Contnrs). Is there any way besides for iterating through objects and building a new TObjectList<> to get this working? Ultimately I would like to couple the TObjectList to an Objectdataset in order to bind to an UI. 回答1: Your question is slightly wrong. The Spring4d TObjectDataSet takes an IObjectList interface which is a specialization of

How to clone a dataset to another BigQuery project

一曲冷凌霜 提交于 2019-12-11 05:54:11
问题 Suppose you have a Google-BigQuery project per Client. Now a new Client is coming aboard. What is the best procedure to clone a project, a dataset or an object like a view to a new project? I have a dataset with a set of views containing analytics logic. It would be great if I could copy those views to the new project. Thanks 回答1: as an option - you can have script that take list of all views in your master dataset with Tables: list API loops through all views (check type property) in list

AttributeError: 'module' object has no attribute '__version__'

旧巷老猫 提交于 2019-12-11 05:54:02
问题 I have installed LDA plibrary (using pip) I have a very simple test code (the next two rows) import lda print lda.datasets.load_reuters() But i keep getting the error AttributeError: 'module' object has no attribute 'datasets' in fact i get that each time i access any attribute/function under lda! 回答1: Do you have a module named lda.py or lda.pyc in the current directory? If so, then your import statement is finding that module instead of the "real" lda module. 来源: https://stackoverflow.com

php convert array into a hierarchical nested set for database

送分小仙女□ 提交于 2019-12-11 05:48:27
问题 So I read this: http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/ And i'm using mysql and php What I need is script that convert only for one time the old data into data with the left/right values. I don't need to add/update things. The php data $in_array = array ( array( 'id' => 400, 'n' => 'Sub 1a', 's' => array ( array ( 'n' => 'Sub 1b', 'id' => 421, 's' => array ( array ( 'n' => 'Sub 1c', 'id' => 422, ) ) ) ) ), array( 'id' => 500, 'n' => 'Sub 2a', 's' => array ( array

How to calculate ranking of one column based on groups defined by another column?

末鹿安然 提交于 2019-12-11 05:40:42
问题 R Version 2.11.1 32-bit on Windows 7 I get a data set as below: USER_A USER_B SCORE 1 6 0.2 1 7 0.1 1 10 0.15 2 6 0.2 2 9 0.12 3 8 0.15 3 9 0.3 the USER_A is 1:3 and the USER_B is 6:10. Now I need to output the USER_A with the ranking of USER_B by their SCORE: USER_A ranking of USER_B 1 3 1 2 #the ranking of USER_B 6,7,10(which belong to USER_A 1) 2 2 1 #the ranking of USER_B 6,9(which belong to USER_A 2) 3 1 2 #the ranking of USER_B 8,9(which belong to USER_A 3) in fact, I just need to

OleDbCommand.Prepare method requires parameters of type '14' have an explicitly set Precision and Scale

爷,独闯天下 提交于 2019-12-11 05:40:36
问题 Using Visual Studio 2010 and I'm encountering an error when attempting to use the DataSet designer. The error is as stated in the subject, "OleDbCommand.Prepare method requires parameters of type '14' have an explicitly set Precision and Scale." I have created a query in a TableAdapter that joins a few tables and returns four columns from the join. I then try to add columns to the DataTable in the designer and receive the error. This error also appears at the end of the end of the

Write data in JSON file in right form JAVA

ぃ、小莉子 提交于 2019-12-11 05:40:10
问题 I have question about the form of the data input in JSON. I save data with a button click in a json file, but the output is wrong. How can I fix this problem, so that the new dataset is after the comma? JSONObject json = new JSONObject(); File filename = new File("dbsettings.json"); json.put("driver", textFieldDriver.getText()); json.put("url", textFieldURL.getText()); json.put("scheme", textFieldscheme.getText()); json.put("name", textFieldDBname.getText()); try { System.out.println(

How can I add data from DataTable to database table directly?

天涯浪子 提交于 2019-12-11 05:18:58
问题 How can I add data from a DataTable to a database table directly? I have searched on the internet not being able to get information from any site. I have a DataTable and now I want to add that data to a database table. importData.Tables[1]; for(int r = 0; r< totalrecoreds; r++;) { Array test[] = importData.Tables[1].Rows[r].ItemArray.ToArray; } What can I do? Do I have to add data one by one using for loop or is there any other method? 回答1: Provided that the schema of the DataTable is the