首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Java小王子

    python常用字典操作范例

    start of a german to english dictionary D1['null'] = 'zero' D1['eins'] = 'one' D1['zwei'] = 'two' D1['drei "Length = ",len(D1) find the value by key (does not change dictionary) print "The english word for drei is ", D1['drei'] better if 'drei' in D1: print "The english word for drei is ", D1['drei'] create '] for no change e3 = D2.pop('drei') print "Extract value for key = 'drei' and delete item from dictionary :" print e3 print "Dictionary D2 after 'drei' has been popped:" print D2 print str1 = "I still miss you

    37420发布于 2021-11-01
  • 来自专栏大师级码师

    python常用字典操作范例

    start of a german to english dictionary D1['null'] = 'zero' D1['eins'] = 'one' D1['zwei'] = 'two' D1['drei "Length = ",len(D1) find the value by key (does not change dictionary) print "The english word for drei is ", D1['drei'] better if 'drei' in D1: print "The english word for drei is ", D1['drei'] create '] for no change e3 = D2.pop('drei') print "Extract value for key = 'drei' and delete item from dictionary :" print e3 print "Dictionary D2 after 'drei' has been popped:" print D2 print str1 = "I still miss you

    37810发布于 2021-11-02
  • 来自专栏前端专享

    如何使用 react 和 three.js 在网站渲染自己的3D模型

    create-react-app my-3d-model #or yarn create react-app my-3d-model 然后安装 @react-three/fiber 和 @react-three/drei npm install three @react-three/fiber @react-three/drei #or yarn add three @react-three/fiber @react-three /drei 将模型转换为 React 组件 完成之后,继续并运行以下命令,使用 gltfjsx 转换成 react 组件格式。 model.glb 转换后的内容类似于以下代码 import React, { useRef } from 'react' import { useGLTF } from '@react-three/drei from 'react' import { Canvas } from '@react-three/fiber' import { OrbitControls } from '@react-three/drei

    10.3K10编辑于 2022-03-30
  • 来自专栏若尘的技术专栏

    Python 持久化 - 文件

    (r"shv.db") try: k1 = shv['one'] print(k1) finally: shv.close() {'eins': 1, 'zwei': 2, 'drei ': 3} {'eins': 1, 'zwei': 2, 'drei': 3} # shelve 忘记写回,需要使用强制写回 shv = shelve.open(r"shv.db", writeback (r"shv.db") try: k1 = shv['one'] print(k1) finally: shv.close() {'eins': 1, 'zwei': 2, 'drei ': 3} {'eins': 100, 'zwei': 2, 'drei': 3} # shelve 使用with管理上下文环境 with shelve.open(r'shv.db', writeback ': 3} {'eins': 1000, 'zwei': 2, 'drei': 3}

    1.4K87发布于 2021-05-11
  • 来自专栏网络安全技术点滴分享

    Three.js实例化技术:高效渲染数千3D对象

    使用drei/instances可以快速实现实例化:import { Instance, Instances } from "@react-three/drei"const boxCount = 1000function 多组实例要渲染森林场景,可能需要不同的实例组:import { createInstances } from "@react-three/drei"const boxCount = 1000const

    50110编辑于 2025-08-17
  • 来自专栏杂谈

    3D个人简历网站 5.天空、鸟、飞机

    Sky.jsx // 从 React 库中导入 useRef 钩子,用于创建可变的 ref 对象 import { useRef } from "react"; // 从 @react-three/drei 库中导入 useGLTF 钩子,用于加载 GLTF 格式的 3D 模型 import { useGLTF } from "@react-three/drei"; // 从 @react-three/fiber / useFrame 用于在每一帧渲染时执行代码,常用于实现动画效果 import { useFrame } from "@react-three/fiber"; // 从 @react-three/drei GLTF 格式的 3D 模型 // useAnimations 用于管理 3D 模型的动画 import { useAnimations, useGLTF } from "@react-three/drei useRef 用于创建可变的 ref 对象,可在组件的整个生命周期内保持值 import { useEffect, useRef } from "react"; // 从 @react-three/drei

    21310编辑于 2025-12-31
  • 来自专栏python3

    Python中字典dict

    print(d['on333']) KeyError: 'on333' # fromkeys: 使用指定的序列作为键,使用一个值作为字典的所有的键的值 l = ["eins", "zwei", "drei fromkeys的调用主体 d = dict.fromkeys(l, "hahahahahah") print(d) {'eins': 'hahahahahah', 'zwei': 'hahahahahah', 'drei

    1.4K20发布于 2020-01-20
  • 来自专栏Python中文社区

    怎样用Python实现地理编码

    怎样用Python实现地理编码 专栏作者:时空Drei ❈ 时空Drei,德国德累斯顿工业大学在读博士生,个人的擅长领域为:利用Python进行空间数据(遥感GIS)处理分析,掌握常用的机器学习工具。

    3.8K70发布于 2018-01-31
  • 来自专栏若尘的技术专栏

    python内置数据结构list、set、dict、tuple(一)

    expected 2) # 双层列表循环变异 # a为嵌套列表,或者叫双层列表 a = [["one", 1, "enis"], ["two", 2, "zwei"], ["three", 3, "drei 的个数应该跟解包出来的变量个数一致 for k,v,w in a: print(k, "--", v, "--", w) one -- 1 -- enis two -- 2 -- zwei three -- 3 -- drei

    1.2K107发布于 2021-02-23
  • 来自专栏刘悦的技术博客

    红袖添香,绝代妖娆,Ruby语言基础入门教程之Ruby3基础数据类型(data types)EP02

    true     也可以使用size或者length方法,判断哈希的大小是否为0: dictionary = { "one" => "eins", "two" => "zwei", "three" => "drei ---- false false     通过delete方法删除键值对: dictionary = { "one" => "eins", "two" => "zwei", "three" => "drei " } dictionary.delete("one") puts dictionary # ---- 输出结果 ---- {"two"=>"zwei", "three"=>"drei"}     需要注意的是

    2.1K20编辑于 2022-10-28
  • 来自专栏锤子代码

    美团发布千亿大模型,效果如何?

    正确,小明手上有6个水果和3个蔬菜 3. gisteren私はcomió три 햄버거,chaque расходы me drei долар,மொத்தம் เท่าไร novac?

    26010编辑于 2025-09-02
  • 使用React-Three-Fiber创建动态图像动画:从3D几何到纹理映射的完整指南

    /Banner/Banner';import { View } from '@/webgl/View';import { PerspectiveCamera } from '@react-three/drei

    51310编辑于 2025-09-04
  • 来自专栏申龙斌的程序人生

    零基础学编程040:在Windows上安装Python库的正确姿势

    本文来自“分享与成长群”成员时空Drei的分享。微信公众号:stdrei,专注于时空数据处理,欢迎点击文末左下角的“阅读原文”进行关注。 --- END ---

    1.7K70发布于 2018-03-06
  • 来自专栏供应链项目实践

    供应链可视化开发实战 | 三维仓库可视化:Three.js在仓储管理中的实践

    from'react';import{Canvas}from'@react-three/fiber';import{OrbitControls,Environment}from'@react-three/drei @react-three/drei:是一个丰富的辅助工具库,提供了诸如OrbitControls(轨道控制器)、Environment(环境)、Text(3D文字)等大量实用组件和高阶函数,极大提升开发效率 importReactfrom'react';import{Grid}from'@react-three/drei';importShelffrom'.

    45030编辑于 2026-03-30
  • 来自专栏python3

    python的元祖,集合,字典的常见函数

    In [81]: d xxxxxxxxxx # fromkeys:使用指定的序列作为键,使用一个值作为字典的所有的键的值 l = ["eins","zwei","drei"] # 注意 fromkeys # 注意 fromkeys 的调用主体 d = dict.fromkeys(l,"heheheh") print(d) {'eins': 'heheheh', 'zwei': 'heheheh', 'drei

    1.8K20发布于 2020-01-19
  • 来自专栏杂谈

    3D个人简历网站 4.小岛

    useRef 钩子,useEffect 用于处理副作用,useRef 用于创建可变引用 import { useEffect, useRef } from "react"; // 从 @react-three/drei 库导入 useGLTF 钩子,用于加载 glTF 模型 import { useGLTF } from "@react-three/drei"; // 从 @react-three/fiber 库导入

    21910编辑于 2025-12-31
  • 来自专栏大数据智能实战

    Attention is all you need新翻译架构的测试

    Wie funktioniert das also - expected: So how does it happen - got: So how does it work - source: Drei will they desire - got: What are they going to consume What are <UNK> - source: Was werden diese drei expected: So we talk about a  a batter who bats - got: We talk about a <UNK> every cell - source: Drei - expected: He kept pointing here - got: And he always showed here - source: Und sie sagte die drei - expected: This is happening to us today - got: This is what we talk today - source: Wir haben drei

    1.6K80发布于 2018-01-09
  • 来自专栏数据科学与人工智能

    【算法】随机森林算法

    来源: 时空Drei segmentfault.com/a/1190000007463203

    1.3K82发布于 2018-03-27
  • 来自专栏人工智能头条

    50种机器学习和预测应用的API,你想要的全都有

    翻译 | Drei 编辑 | Just 出品 | 人工智能头条(公众号ID:AI_Thinker) API 是一套用于构建软件程序的协议和工具。

    2.4K70发布于 2018-06-05
  • Day 1:我让AI帮我建项目,结果把3D洗衣机"拆"了

    AI 帮我装了一堆依赖包: three ← 3D引擎本体 @react-three/fiber ← React版的3D渲染器 @react-three/drei

    17310编辑于 2026-04-16
领券