如何使用不同的长度为CSV中的值分配索引。(How to assign indexes to values in CSV using different lengths. (Java))
我正在尝试将两个不同CSV文件中的值对齐到类似索引。 一个CSV每秒钟都有一个unix时间戳,每分钟都有一个。 另外,我需要在不同长度的数据上标记索引。
因此,例如,我需要将指数分为1 - 20(和秒1 - 1200),指数为0,然后是指数21 - 25(1260 - 1500),指数为1,分钟为26 - 42(1560 - 2520),指数为2等
长度将根据我正在使用的数据(可能是包含长度的不同值的数组)而变化,因此我想以编程方式执行此操作。 我不确定如何解决这个问题。 任何帮助将不胜感激。
编辑(希望这有助于澄清一些)
我有一个CSV中的数据,其中包含有关音频的信息,另一个CSV中包含有关生物度量数据的信息。 它们都有一个具有unix时间戳的列。 音频CSV中的数据是每秒一次,生物指标数据是每分钟一次。
我想在CSV中添加一个具有相同索引(或键)值的附加行,以便数据在两个文件之间具有公共链接。 如果我调用索引1,我想从两个索引为1的文件中获取数据。
音频文件的长度将决定键的开始和停止位置。 因此,如果我有一个2分钟长的音频文件,生物指标CSV中的2行将具有0的键,而音频CSV的120行将具有0的键。
如果该音频文件已经3分钟长,则生物度量CSV的前3行将具有0的键,并且音频CSV的前180行将具有0的键。
I'm trying to align values in two different CSV files to like indexes. One CSV has a unix time stamp every second and the other every minute. Additionally I need to mark the indexes pn various lengths of the data.
So for example I would need to mark minutes 1 - 20 (and seconds 1 - 1200) with the index of 0, then minutes 21 - 25 (1260 - 1500) with index 1, minutes 26 - 42 (1560 - 2520) with index 2, etc. etc.
The length will vary depending on the data (possibly an array that holds the different values for the lengths) that I am using so I would like to do this programatically. I'm not sure how to attack this problem. Any help would be greatly appreciated.
Edit (hopefully this helps clarify some)
I have data in one CSV that has information about audio and another that has information about bio-metric data. They will both have a column that has a unix time stamp. The data in the audio CSV is for every second and the bio-metric data is for every minute.
I want to add an additional row to the CSV's that have the same index(or key) value so that the data has a common link between the two files. If I call index 1 I want to get the data from both files that have an index of 1.
The length of an audio file will determine where the keys start and stop. So if I had an audio file that was 2 minutes long, 2 rows in the bio-metric CSV will have a key of 0 and 120 rows of the audio CSV will have a key of 0.
If that audio file had been 3 minutes long the first 3 rows of the bio-metric CSV would have a key of 0 and the first 180 rows of the audio CSV would have the a key of 0.
原文:https://stackoverflow.com/questions/22340439
最满意答案
如果您有特定流的
videoId
,则可以使用未记录的live_stats端点来获取查看者的数量:https://www.youtube.com/live_stats?v={videoid}
If you have the specific stream's
videoId
you can use the undocumented live_stats endpoint to get the number of viewers:https://www.youtube.com/live_stats?v={videoid}
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
是否可以在Youtube游戏直播中获取用户列表(Is it possible to get a list of users in a Youtube Gaming Live Stream)[2022-04-13]
如果您有特定流的videoId ,则可以使用未记录的live_stats端点来获取查看者的数量: https://www.youtube.com/live_stats?v={videoid} If you have the specific stream's videoId you can use the undocumented live_stats endpoint to get the number of viewers: https://www.youtube.com/live_stats?v={ ... -
Youtube API v3 - 获取“Live Now”rtmp和streamkey(Youtube API v3 - Get “Live Now” rtmp and streamkey)[2022-03-16]
您无法检索“Live Now”摄入信息,因为API不会区分“Live Now”和“Events”。 这两个选项作为最终用户API的接口提供,因此他们不必编写自己的与API接口的应用程序。 您将不得不手动设置liveBroadcast和liveStream对象,将它们与liveBroadcasts.bind绑定,测试您的流并使用status.streamStatus转换到liveStream对象上。 You cannot retrieve "Live Now" ingestion info because t ... -
我通过使用此请求找到了答案: var request = service.Search.List("snippet"); request.Q = txtSearch.Text.Trim(); request.EventType = SearchResource.ListRequest.EventTypeEnum.Live; request.Type = "video"; request.MaxResults = 10; req ...
-
播放Youtube视频没有问题(当然它的流媒体协议是rtmp),但据我所知,你无法将传入流的视频附加到传出视频,因为attachVideo / attachAudio方法只能使用Camera / Microphone作为输入。 如果你想将某些内容重新发送到你的服务器,你可以使用FFmpeg,它真的很容易! There are no problems with playing Youtube video (of course it's streaming protocol is rtmp), but as f ...
-
Youtube直播字幕(Youtube Live streaming captions)[2022-06-17]
你可以参考这个线程 。 请确保在每条消息的末尾放置一个新行字符\n ,其中每条消息由根据示例的时间和文本组成。 另外,请注意这个Live标题要求 。 为了给您的直播活动添加字幕,您需要将字幕发送到嵌入视频中的YouTube或通过可以通过HTTP POST发送字幕的受支持软件。 You may refer with this thread. Make sure that you put a new line character \n at the end of each message where each ... -
获取youtube用户列表(Getting a list of youtube users)[2023-07-11]
您是否可以从YouTube获取用户列表,这是值得怀疑的。 有关使用YouTube PHP API可以执行的操作,请参阅developers_guide_php it is doubtful that you can get a list of users from YouTube see comments above. please see the developers_guide_php for what you can do with the YouTube PHP API -
如何使用IFrame API嵌入“YouTube游戏”视频?(How do I embed a 'YouTube Gaming' video with the IFrame API?)[2022-09-22]
您无需使用gaming.youtube.com 。 www.youtube.com有效! I pass an undocumented host property to the constructor. It seems to work fine. var player; function onYouTubeIframeAPIReady() { player = new YT.Player('player', { height: '390', width: '640', host ... -
这是我的代码,我得到广播和流媒体状态: 广播状态得到: liveStreamRequest = youtube.liveStreams() .list("id,status") .setId(liveBroadcast.getContentDetails() .getBoundStreamId()); LiveStreamListResponse returnedList = liveStreamRequest.execute(); List< ...