我有大量的数据框。 我想删除一个特定的数据框,例如在此示例中为d2。
>>> data2 = [{'a': 1, 'b': 2}, {'a': 10, 'c': 13}, {'a': 20, 'b': {'d': 100, 'e': 101}, 'c': 23}, {'a': 30, 'b': 31, 'c': {'d': 300}}]
>>> map_at(type,['*',['b','c'],'d'],data2)
{0: {'a': 1, 'b': 2}, 1: {'a': 10, 'c': 13}, 2: {'a': 20, 'b': {'d': <class 'int'>, 'e': 101}, 'c': 23}, 3: {'a': 30, 'b': 31, 'c': {'d': <class 'int'>}}}
答案 0 :(得分:4)
一些选项:
# assign it to NULL
my.list$d2 = NULL
my.list[["d2"]] = NULL
# remove second item
my.list = my.list[-2]
# subset by name
my.list = my.list[names(my.list) != "d2"]
答案 1 :(得分:2)
这将从列表中删除第二个元素。
[Authorize]
[HttpGet]
public async Task<ActionResult> Unload()
{
byte[] viewData = view.BuildFile(ControllerContext);
...
byte[] combinedViewData = await Task.Run(()=> combineViewData(viewDatas));
return File(combinedViewData, "application/pdf");
}