我的csv文件很大,我只需要提取与以下模式匹配的行 例如
// CDN transcoding settings.
var LiveTranscoding = {
// Width of the video (px). The default value is 640.
width: 640,
// Height of the video (px). The default value is 360.
height: 360,
// Bitrate of the video (Kbps). The default value is 400.
videoBitrate: 400,
// Frame rate of the video (fps). The default value is 15. Agora adjusts all values over 30 to 30.
videoFramerate: 15,
audioSampleRate: AgoraRTC.AUDIO_SAMPLE_RATE_48000,
audioBitrate: 48,
audioChannels: 1,
videoGop: 30,
// Video codec profile. Choose to set as Baseline (66), Main (77), or High (100). If you set this parameter to other values, Agora adjusts it to the default value of 100.
videoCodecProfile: AgoraRTC.VIDEO_CODEC_PROFILE_HIGH,
userCount: 1,
userConfigExtraInfo: {},
backgroundColor: 0x000000,
// Sets the output layout for each user.
transcodingUsers: [{
x: 0,
y: 0,
width: 640,
height: 360,
zOrder: 0,
alpha: 1.0,
// The uid must be identical to the uid used in Client.join.
uid: 1232,
}],
};
client.setLiveTranscoding(LiveTranscoding);
// Adds a URL to which the host pushes a stream. Set the transcodingEnabled parameter as true to enable the transcoding service. Once transcoding is enabled, you need to set the live transcoding configurations by calling the setLiveTranscoding method. We do not recommend transcoding in the case of a single host.
client.startLiveStreaming("your RTMP URL", true)
// Removes a URL to which the host pushes a stream.
client.stopLiveStreaming("your RTMP URL")
模式是
A
Abc://a/b/c/1/2/3
Abc://a/b/c/d/1/2/3
Abc://a/b/c
Abc://a/b/c/e/f/g
请分享您的想法。谢谢!
答案 0 :(得分:0)
您可以像这样使用.loc
索引功能:
df.loc[df['A'] == 'Abc://a/b/c/1/2/3') &
df['A'] == 'Abc://a/b/c/e/f/g')]
答案 1 :(得分:0)
mask = df['PATR'].str.contains('Abc://a/b/c/(?!$)', na=False)
df1 = df[mask]
df2 = df[~mask]
尝试一下,可能会起作用