熊猫数据框更新键

时间:2019-05-22 05:32:25

标签: python pandas

我无法使用::功能更新熊猫final List<String> list; ... // list initialization; list = br.lines().collect(Collectors.toList()); ... Map<Integer, String> fileNumWithContentMapper = IntStream .range(0, list.size()) // IntStream .boxed() // Stream<Integer> .collect(Collectors.toMap(i -> i, i -> list.get(i))); // Map<Integer, String> ,我总是得到final List<String> list; ... // list initialization; list = br.lines().collect(Collectors.toList()); ... Map<Integer, String> fileNumWithContentMapper = IntStream .range(0, list.size()) // IntStream .boxed() // Stream<Integer> .collect(Collectors.toMap(Function.identity(), list::get)) // Map<Integer, String> 的结果。 我正在使用带有密钥的var COLUMNTOCHECK1 = 5; var COLUMNTOCHECK2 = 6; var DATETIMELOCATION1 = [0,2]; var DATETIMELOCATION2 = [0,3]; var SHEETNAME = 'OrderList' function onEdit(e) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); if( sheet.getSheetName() == SHEETNAME ) { var selectedCell = ss.getActiveCell(); if( selectedCell.getColumn() == COLUMNTOCHECK1) { var email = Session.getActiveUser().getEmail(); var dateTimeCell = selectedCell.offset(DATETIMELOCATION1[0],DATETIMELOCATION1[1]); dateTimeCell.setValue(new Date()); var dateTimeCell1 = selectedCell.offset(DATETIMELOCATION2[0],DATETIMELOCATION2[1]); dateTimeCell1.setValue(email); } if( selectedCell.getColumn() == COLUMNTOCHECK2) { var dateTimeCell = selectedCell.offset(DATETIMELOCATION2[0],DATETIMELOCATION2[1]); dateTimeCell.setValue(new Date()); } } } ,这是加入2 Dataframe的结果。

我只计算pd.update()列的None,然后用Dataframe列的新值更新Dataframes

z1 score
float32

当我运行Dataframe时,它总是返回float32

稍后,我需要重用缩放器对象以计算新数据帧的z得分。

2 个答案:

答案 0 :(得分:1)

DataFrame update是就地操作。它将始终返回None,但是将修改数据框。

答案 1 :(得分:1)

如果添加到集合中,则说明您正在执行就地操作,该操作将返回None。该系列将被更新,但返回的副本将为None