🍰
Grasshopper ES por BetweenRealities
  • Using and Generating Documentation
    • GitHub
    • Discord
      • Speckle Webhooks
    • Speckle Client
  • Potencial technological implementations
  • 🧞Compute
    • Introducción a Grasshopper
      • Customizar Entorno
        • VSCode
      • Rhinoceros 3d
      • Hops
      • Galapagos
    • Modelos Informados
      • Comportamiento Estructural
        • Automatizar cálculo Python
      • OOP
      • Rhino Inside Revit
        • Revit
          • Modelado 3d en Revit
          • Certificación profesional Revit
      • Energía
    • Procesos Urbanos
      • Automatizar Qgis
      • Librerías Python
      • Librerías Grasshopper
      • Stable Diffusion
    • Programación
      • RhinoPython
        • Anatomía del script
        • Python básico
        • Tuples, listas y diccionarios
        • Operadores y funciones
        • Ejecución condicional
        • Geometría
        • Clases
      • Multithread
  • 🪅Database
    • Lenguaje Python
      • Types and operations
      • Statements and syntax
      • Function and generators
      • Modules and packages
      • Classes and OPP
      • Exception and tools
      • Advance topics
    • Análisis de la Información
      • Comparison with SQL
      • Comparison with R / R libraries
      • Pandas
    • Abrir Acceso
      • Rest API Abierta
    • Blockchain Descentralización
  • 🕸️COLLECT
    • Captura de Datos
      • Raspberry Pi
        • Encendido y apagado automático
      • Arduino
      • UAS
      • Fotogrametría
        • Crashes
    • Técnicas Machine Learning
      • Clasificación
      • Computer Vision
    • Computación en la Nube
      • Contenedores
      • Azure
      • Ubuntu Server Deploy
      • PostgreSQL Server
      • Rhino Compute Deploy
  • 🍭INTERACT
    • Introducción a Unreal Engine
      • Ejecutar Python
      • Datasmith
      • Materiales
        • Crear PBR
        • Materiales Introducción
      • Iluminación
        • Iluminación Introducción
        • Raytraced Iluminación Cinemática
      • Assets Management
    • Interacción Inmersiva
      • Blueprints
        • Blueprints estandar
        • Blueprints Introducción
        • Diseño Nivel
      • Packaging
      • Performance
    • Interfaces Bidimensionales
Con tecnología de GitBook
En esta página

¿Te fue útil?

  1. Database
  2. Lenguaje Python

Types and operations

Types and operations

  • Introducing Python objects types: The Python Conceptual hierarchy; Built-in types; Core data types; Numbers; Strings; Lists; Dictionaries; Tuples; Files; Other core types.

Python core data types: numbers, strings, lists, dictionaries, tuples, files and sets. Why are they called core data types?: part of the Python language itself, import module and specific syntax. Definition and types of 'immutable': cannot be changed after it is created, like numbers, strings and tuples, but you can create new ones. Definition and types of 'sequence': Positionally ordered collection of objects; strings, list and tuples; common sequence operation as indexing, concatenation and slicing. Definition and types of 'mapping': maps keys to associated values; access to data stored by key.

  • Numeric types: Numeric type basic; Numbers in action; Other numeric types; numeric extensions.

What tools can you use to find a number's square root, as well as its square?: importing math module '**'. How can you truncate and round a floating-point number?: the int() and math.trunc(), round(N, digits), math.floor(N). How can you convert an integer to a floating-point number?: float(I).

  • Dynamic typing interlude: Missing declaration statements; Shared references; Dynamic typing.

How variables and objects are associated by references; garbage collection shared references to objects can affect multiple variables.

  • String fundamentals: String basics; String literals; Strings in actions; string methods; String formatting expressions; Formatting methods calls; General type categories.

Find method to search a list?:methods are type-specific, single data type. Slice expression in a list?: generic and apply to many types, when you slice you get back a new list. Changing a string in python?: creating new string by concatenating, slicing, formatting, replacing. Extract words from a sentence: slicing and using indexes. Use string module instead of string method calls: it's deprecated.

  • List and dictionaries: Lists (positionally ordered collections of arbitrary objects, freely nested and grown and shrunk on demand); Dictionaries (stores items by key, mutable also). Mutable so support in-place change operations (append call or assign new keys).

2 ways to build a list containing 5 integer zeros. 2 ways to build a dict with 2 keys. 4 operations that change a list object in place: append, sort, insert, pop, del. 4 operations that change a dict object in place: update, d.pop(key). Why might you use a dict instead of a list?: when data is labeled for lookup quicker.

[0]*5; L.append(0); ([0 for i in range(5)])

dict(a=0, b=0) or dict([('a', 0), ('b', 0)]) or dict.fromkeys('ab', 0) or {k:0 for k in 'ab'}

  
  • Tuples, files and everything else: Tuples (sequence operation, immutable); Files (open function for read and write data; pickle, json, struct modules); Core types; Built-in gotchas.

How large a tuple is?: len built-in function. Modify a tuple: they are immutable, you have to generate a new one. What module might you use to store py object without converting them to string?: pickle, struct (binary format), json (string per the json format) module.How might you go about copying all parts of a nested structure at once?: import copy module an call copy.deepcopy(c). When does Python consider an object true?: nonzero number or a nonempty collection object.

AnteriorLenguaje PythonSiguienteStatements and syntax

Última actualización hace 2 años

¿Te fue útil?

🪅