import-from-csv

DM Script to import a 2D image in text (CSV) format

纵然是瞬间 提交于 2021-01-28 09:20:42
问题 Using the built-in "Import Data..." functionality we can import a properly formatted text file (like CSV and/or tab-delimited) as an image. It is rather straight forward to write a script to do so. However, my scripting approach is not efficient - which requires me to loop through each raw (use the "StreamReadTextLine" function) so it takes a while to get a 512x512 image imported. Is there a better way or an "undocumented" script function that I can tap in? 回答1: DigitalMicrograph offers an

How to download data from Yahoo finance limited to 100 rows

浪尽此生 提交于 2020-07-19 06:49:20
问题 So I'm doing this project where I have to download historical stock data from yahoo finance. Got this code. It's working fine, BUT it only downloads max 100 rows. I tried to scan the web for answers or a different code (this one is just recorded macro from excel) but I saw a few tutorials on YouTube that use his solution and it's just fine. .. I don't understand it then Sub Makro6() ' Dowload stock prices from Yahoo Finance based on input Dim ws As Worksheet Set ws = Sheets("Data") 'clear

Yii2 - Import Multiple users from CSV file

為{幸葍}努か 提交于 2020-05-17 08:46:20
问题 I have two tables. one is user-table -name - user and another table named profile. The format of csv file for user is like this: first_name,last_name,username,email,phone,user_role,status,password_hash,auth_key,created_at,updated_at,key_date,reset_key,access_token Abx,xyz ,8917111039,abca@examplemail.com,891445544,employee,10,$2y$13$jbsLKjG6YtiA1RbilUOeauAS2Zvq5fHB5xh6JnHpfVytvI56IiO32,,,,,, Alek,buhu,7978019779,sahu_alek@examplemail.com,7978444449,employee,10,$2y$13

Reading a non-standard CSV File into R

倾然丶 夕夏残阳落幕 提交于 2020-03-19 06:14:05
问题 Im trying to read the following csv file into R http://asic.gov.au/Reports/YTD/2015/RR20150511-001-SSDailyYTD.csv The code im currently using is: url <- "http://asic.gov.au/Reports/YTD/2015/RR20150511-001-SSDailyYTD.csv" shorthistory <- read.csv(url, skip = 4) However I keep getting the following error. 1: In readLines(file, skip) : line 1 appears to contain an embedded nul 2: In readLines(file, skip) : line 2 appears to contain an embedded nul 3: In readLines(file, skip) : line 3 appears to

How to plot line graph in R with years as x-axis and y-axis as count?

只谈情不闲聊 提交于 2020-02-06 18:59:05
问题 I have a dataset that looks like this: Year AL AK AZ AR CA CO 1993 135 153 113 157 718 516 1994 218 154 184 185 845 465 1995 482 846 683 682 863 863 I want to plot line graphs over time, so x-axis is year, y-axis is the count and each line would be a state. How can I get the year to show up on the x-axis? I've been running this: data <- read.csv("data.csv", header=T) plot(data$AL, type="l") par(new=T) plot(data$AK, type="l") ..... Except with what I have above, the x-axis is "Index" but I

exporting table with blob and utf8 string fields from MySql to MS Sql server 2014

你。 提交于 2020-01-17 03:15:06
问题 I have a table with binary(32), blob and varchar utf-8 fields. from one mysql server to another I export data via csv: select * INTO OUTFILE '$tmp_fname' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\\r\\n' from mytable and then load data local infile '" . $mysqli->real_escape_string($glb) . "' ignore into table mytable_temp CHARACTER SET 'utf8' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\\n' I tried the same with bulk insert in

Converting CSV to HTML Table in Python

独自空忆成欢 提交于 2020-01-12 08:26:14
问题 I'm trying to take data from a .csv file and importing into a HTML table within python. This is the csv file https://www.mediafire.com/?mootyaa33bmijiq Context: The csv is populated with data from a football team [Age group, Round, Opposition, Team Score, Opposition Score, Location]. I need to be able to select a specific age group and only display those details in separate tables. This is all I've got so far.... infile = open("Crushers.csv","r") for line in infile: row = line.split(",") age

Quotation issues reading data into R

本小妞迷上赌 提交于 2020-01-03 14:17:21
问题 I have some data from and I am trying to load it into R . It is in .csv files and I can view the data in both Excel and OpenOffice. (If you are curious, it is the 2011 poll results data from Elections Canada data available here). The data is coded in an unusual manner. A typical line is: 12002,Central Nova","Nova-Centre"," 1","River John",N,N,"",1,299,"Chisholm","","Matthew","Green Party","Parti Vert",N,N,11 There is a " on the end of the Central-Nova but not at the beginning. So in order to

Finding Maximum Value in CSV File

五迷三道 提交于 2019-12-31 07:38:10
问题 Have an assignment of finding average and maximum rainfall in file "BoulderWeatherData.csv". Have found the average using this code: rain = open("BoulderWeatherData.csv", "r") data = rain.readline() print(rain) data = rain.readlines() total = 0 linecounter = 0 for rain in data: linecounter = linecounter + 1 print("The number of lines is", linecounter) for line in data: r = line.split(",") total = total + float(r[4]) print(total) average = float(total / linecounter) print("The average rainfall

Python create a table into variable from a csv file

别说谁变了你拦得住时间么 提交于 2019-12-31 07:03:30
问题 I want to create a table into variable something that looks like actual csv file: Length Price Code 10.05 0.78 AB89H 20 5 HB20K This is something that What I do to every function I am working with So maybe I can do it once perhaps... tree_file.readline() # skip first row for row in tree_file: field=row.strip() field=field.split(",") #make Into fields price=int(field[1]) I want a function that create a table from csv file so I can use this table for all my other function. So I don't have to