group-by

    0熱度

    1回答

    鑑於這一數據框: C index  0   9 1   0 2   1 3   5 4   0 5 1 6 2 7 20 8 0 我怎麼能分裂成組這使得 1組具有[9, 0], 2組有[1, 5, 0], 組3有[1, 2, 20, 0]? 這個想法是找到所有以0結尾的序列並將它們組合在一起。該序列可以大小不一,並且最後順序可能不以0結束的第一個元素將永

    0熱度

    2回答

    所以,我想要做的是檢索所有的「初始」消息的人在他們的消息窗口看到清單 這是表結構 thread_id | sender | receiver | message | date | sender_deleted | sender_received | read xRdaQ | bTP5n | lCBNA | hello! | date | 0 | 0 | xRdaQ | lCBN

    0熱度

    1回答

    我想要得到的行數由B柱這樣的組合在A列中每個不同的值: ------------------------------------------------------ | B | AValue1 | AValue2 | Avalue3 | AValue4 | ...... | ------------------------------------------------------ |B1

    1熱度

    3回答

    我有一個數據幀 df = pd.DataFrame({'id':['one','one','two','two','three','three','three'], 'type':['current','saving','current','current','current','saving','credit']}) 我想算ID的數量只有具有「當前」 東西想: only_c

    0熱度

    3回答

    我有一個名爲FileRecordDto的DTO,其屬性是一個字符串字典。這本字典代表一筆交易記錄。值均爲字符串和鍵是列名: public class FileRecordDto { public IDictionary<string, string> Fields { get; internal set; } = new Dictionary<string, string>

    -2熱度

    2回答

    好時光!告訴我如何優化這個查詢,如果可能的話,把它合併成一個! $query = "SELECT external_source_id FROM smf_tds_unique_statistic WHERE ".$dateRange." GROUP BY external_source_id ORDER BY external_source_id ASC;"; $query .= "SELECT

    1熱度

    2回答

    我有問題讓列排隊,start_time是end_time之上的一行。 這是我的代碼: SELECT B.NAME ,MAX(case when DESCRIPTION = 'Green' then Final_Value end) as Start_Time ,MAX(case when DESCRIPTION = 'Red' then Final_Value end) a

    2熱度

    3回答

    我處理的一個熊貓數據幀像這樣的: Day Hour Prio Value 0 1 6 Critical 1 1 1 16 Critical 1 2 1 17 Content 1 3 1 17 Low 1 6 1 19 Critical 1 7 1 20 High 1 8 2 10 High 1 9 2 10 Low 2

    3熱度

    2回答

    我的假設數據幀是 df = pd.DataFrame({'col1':[91,91,91,91,92,92,92,92], 'col2':[91,92]*4,'value':[10]*8}) df col1 col2 value 0 91 91 10 1 91 92 10 2 91 91 10 3 91 92 10 4 92 91 10 5 92 92

    1熱度

    2回答

    我的數據如下所示。 ID Position Treatment --20AxECvv- 0 A --20AxECvv- -1 C --20AxECvv- -2 B --h9INKewQf- 0 A --h9INKewQf- -1 B [email protected] 0 C QUeSNEXmdB 0 C QUeSNEX