format-conversion

How to read .npy files in Matlab

房东的猫 提交于 2021-01-18 07:46:25
问题 I was wondering if there is way to read .npy files in Matlab? I know I can convert those to Matlab-style .mat files using scipy.io.savemat in Python; however I'm more interested in a native or plugin support for .npy files in Matlab. 回答1: There is a c++ library available https://github.com/rogersce/cnpy You could write a mex function to read the data. I would prefer to store everything in hdf5 回答2: This did the job for me, I used it to read npy files. https://github.com/kwikteam/npy-matlab If

c# extract mp3 file from mp4 file

混江龙づ霸主 提交于 2020-01-17 12:24:27
问题 is there any easy way of extracting a mp3 file from a mp4 file? I've already tried to change the file extension, but that won't let me to edit the mp3 description. thank you! 回答1: Use Xabe.FFmpeg. It's free (non-commercial use), has public repository on GitHub, cross-platform (written in .NET Standard). Extracting mp3 from mp4 just by 3 lines: string output = Path.ChangeExtension(Path.GetTempFileName(), FileExtensions.Mp3); IConversionResult result = await Conversion.ExtractAudio(Resources

c# extract mp3 file from mp4 file

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-17 12:23:38
问题 is there any easy way of extracting a mp3 file from a mp4 file? I've already tried to change the file extension, but that won't let me to edit the mp3 description. thank you! 回答1: Use Xabe.FFmpeg. It's free (non-commercial use), has public repository on GitHub, cross-platform (written in .NET Standard). Extracting mp3 from mp4 just by 3 lines: string output = Path.ChangeExtension(Path.GetTempFileName(), FileExtensions.Mp3); IConversionResult result = await Conversion.ExtractAudio(Resources

Subset dates in the wrong format in R

喜欢而已 提交于 2019-12-24 18:09:55
问题 I have questionnaire data where participants have inputted their date of birth in a wide variety of formats: ID <- c(101,102,103,104,105,106,107) dob <- c("20/04/2001","29/10/2000","September 1 2012","15/11/00","20.01.1999","April 20th 1999", "04/08/01") df <- data.frame(ID, dob) Before doing any analysis, I need to be able to subset the data when it is not in the correct format (i.e. dd/mm/yr) and then correct each cell in turn manually. I tried using: df$dob <- strptime(dob, "%d/%m/%Y") ...

Converting data from .csv file to .json - Python

瘦欲@ 提交于 2019-12-20 04:51:46
问题 I need to convert data from my csv file to the one i am gonna use which is .js . Lp.;Name;Surname;Desc;Unit;Comment 1;Jan;Makowski;Inf;km; 2;Anna;Nowak;Pts;km;Brak reakcji If you can see column 'comment' does not always have record and I need to keep it that way. Also between data there is amount of tabs I need to set as well. I've a file,i am working on right now but It show's me data in row like : [{"Lp.;Name;Surname;Desc;Unit;Comment": "1;Jan;Makowski;Inf;km;"}, {"Lp.;Name;Surname;Desc

Converting data from .csv file to .json - Python

China☆狼群 提交于 2019-12-20 04:51:24
问题 I need to convert data from my csv file to the one i am gonna use which is .js . Lp.;Name;Surname;Desc;Unit;Comment 1;Jan;Makowski;Inf;km; 2;Anna;Nowak;Pts;km;Brak reakcji If you can see column 'comment' does not always have record and I need to keep it that way. Also between data there is amount of tabs I need to set as well. I've a file,i am working on right now but It show's me data in row like : [{"Lp.;Name;Surname;Desc;Unit;Comment": "1;Jan;Makowski;Inf;km;"}, {"Lp.;Name;Surname;Desc

Is there a way to convert JSON-LD to N-Quads format?

白昼怎懂夜的黑 提交于 2019-12-11 18:08:36
问题 We have a requirement where we will be storing data in JSON-LD format for maintaining catalog and data from catalog will be pulled in batches to graph DB which supports RDF data format. We have been looking at Cayley and DBgraph for this purpose but these DB support N-Quads as their data format. If there is a graph db which has JSON-LD data format or if there is way to convert JSON-LD format to N-Quads/Turtle format? 回答1: Converting JSON-LD to N-Quads (and back) are core algorithms described

RGB to YCbCr Conversion problems

懵懂的女人 提交于 2019-12-07 02:57:37
问题 i need convert RGB image to YCbCr colour space, but have some colour shift problems, i used all formulas and got the same result. Formula in python cbcr[0] = int(0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]) #Y cbcr[1] = int(-0.1687*rgb[0] - 0.3313*rgb[1] + 0.5*rgb[2] + 128) #Cb cbcr[2] = int( 0.5*rgb[0] - 0.4187*rgb[1] - 0.0813*rgb[2] + 128) #Cr I know that i should get the same image with different way to record data, but i got wrong colour result. http://i.imgur.com/zHuv8yq.png Original http

xml to json mapping challenge

只谈情不闲聊 提交于 2019-12-06 01:00:23
问题 At first glance, I thought using xml data in javascript would be as simple as finding an xml-to-json library and turning my xml into a javascript object tree. Now, however, I'm realizing that it's possible to create structures in xml that don't map directly to json. Specifically, this: <parentNode> <fooNode>data1</fooNode> <barNode>data2</barNode> <fooNode>data3</fooNode> </parentNode> The xml-to-json tools I've found convert the previous to something like this: { parentnode:{ foonode:[

xml to json mapping challenge

荒凉一梦 提交于 2019-12-04 05:31:06
At first glance, I thought using xml data in javascript would be as simple as finding an xml-to-json library and turning my xml into a javascript object tree. Now, however, I'm realizing that it's possible to create structures in xml that don't map directly to json. Specifically, this: <parentNode> <fooNode>data1</fooNode> <barNode>data2</barNode> <fooNode>data3</fooNode> </parentNode> The xml-to-json tools I've found convert the previous to something like this: { parentnode:{ foonode:[ 'data1', 'data3' ], barnode:'data2' } } in which, the order of the child nodes has been changed. I need to