data[var] = data[var].fillna(-100)
时间: 2023-12-24 09:03:09 浏览: 26
This code is filling missing values in a variable "var" with -100.
Here, "data" is a dataframe and "var" is a column in the dataframe.
The method "fillna()" fills the missing values in the column with the specified value, which is -100 in this case.
相关问题
var tableCode = $('.table-code'); var tmpArr = []; tableCode.each(function(i, e) { var dataTmp = $(this).data('tmp'); //去重 var tmpCount = 1; if(tmpArr.indexOf(dataTmp)==-1){ tmpArr.push(dataTmp); var tmps = $('div[data-tmp="'+dataTmp+'"]'); tmps.each(function (itmps,etmps) { var lbxxdyRows = $(etmps).find('div.lbxxdy-row[data-title="Y"]'); console.log(lbxxdyRows); }) } });查询lbxxdyRows中的子div class='lbxxdy-table-num'对象,并且设置html值
要查询lbxxdyRows中的子div class='lbxxdy-table-num'对象并设置其html值,你可以使用以下代码:
```javascript
var tableCode = $('.table-code');
var tmpArr = [];
tableCode.each(function(i, e) {
var dataTmp = $(this).data('tmp');
var tmpCount = 1;
if (tmpArr.indexOf(dataTmp) == -1) {
tmpArr.push(dataTmp);
var tmps = $('div[data-tmp="' + dataTmp + '"]');
tmps.each(function(itmps, etmps) {
var lbxxdyRows = $(etmps).find('div.lbxxdy-row[data-title="Y"]');
lbxxdyRows.each(function() {
var lbxxdyTableNums = $(this).find('div.lbxxdy-table-num');
lbxxdyTableNums.html("your html value"); // 设置html值
});
});
}
});
```
在`lbxxdyTableNums.html("your html value");`这行代码中,将"your html value"替换为你想设置的HTML值。这段代码会遍历lbxxdyRows中的子div,找到class为"lbxxdy-table-num"的对象,并设置其html值。
saveGoods: function (e) { var that = this; var goodsName = e.detail.value.goodsName; var goodsDesc = e.detail.value.goodsDesc; var newPrice = e.detail.value.newPrice; var oldPrice = e.detail.value.oldPrice; var mobile = e.detail.value.mobile; let imgFilePaths = that.data.img_url; var uInfo = app.globalData.userInfo;
这是一段小程序中的 JavaScript 代码,大概的功能是保存商品信息。在这段代码中,首先获取了表单中输入的商品名称、商品描述、新旧价格、手机号码等信息,然后将上传的图片路径保存到变量 imgFilePaths 中,最后获取了全局变量 app.globalData.userInfo 中的用户信息。这个函数的具体实现可能还涉及到后续的数据处理和存储,可以根据具体的业务需要进行完善。