class_docstr: A pythonic computation and processing framework.
  
  DataCollection is a pythonic computation and processing framework for unstructured
  data in machine learning and data science. It allows a data scientist or researcher
  to assemble data processing pipelines and do their model work (embedding,
  transforming, or classification) with a method-chaining style API.
  
  Args:
      data ('towhee.runtime.DataQueue'):
          The data to be stored in DataColletion in the form of DataQueue.
  
  Examples:
      >>> from towhee.runtime.data_queue import DataQueue, ColumnType
      >>> from towhee.datacollection.data_collection import DataCollection
      >>> dq = DataQueue([('a', ColumnType.SCALAR), ('b', ColumnType.QUEUE)])
      >>> dq.put(('a', 'b1'))
      True
      >>> DataCollection(dq)
      <DataCollection Schema[a: ColumnType.SCALAR, b: ColumnType.QUEUE] SIZE 1>
class_docstr_tok: ["A","pythonic","computation","and","processing","framework",".","DataCollection","is","a","pythonic","computation","and","processing","framework","for","unstructured","data","in","machine","learning","and","data","science",".","It","allows","a","data","scientist","or","researcher","to","assemble","data","processing","pipelines","and","do","their","model","work","(","embedding",",","transforming",",","or","classification",")","with","a","method-chaining","style","API",".","Args",":","data","(","'towhee.runtime.DataQueue","'",")",":","The","data","to","be","stored","in","DataColletion","in","the","form","of","DataQueue",".","Examples",":",">",">",">","from","towhee.runtime.data_queue","import","DataQueue",",","ColumnType",">",">",">","from","towhee.datacollection.data_collection","import","DataCollection",">",">",">","dq","=","DataQueue","(","[","(","'","a","'",",","ColumnType.SCALAR",")",",","(","'","b","'",",","ColumnType.QUEUE",")","]",")",">",">",">","dq.put","(","(","'","a","'",",","'b1","'",")",")","True",">",">",">","DataCollection","(","dq",")","<","DataCollection","Schema","[","a",":","ColumnType.SCALAR",",","b",":","ColumnType.QUEUE","]","SIZE","1",">"]
code: def __init__(self, data):
      if isinstance(data, dict):
          self._schema = data["schema"]
          self._type_schema = [
              ColumnType[type] for type in data["type_schema"]
          ]
          self._iterable = [
              Entity.from_dict(dict(zip(data["schema"], entity)))
              for entity in data["iterable"]
          ]
      else:
          self._schema = data.schema
          self._type_schema = data.type_schema
          self._iterable = [
              Entity.from_dict(dict(zip(self._schema, data.get())))
              for _ in range(data.size)
          ]
  
file_path: towhee/towhee/datacollection/data_collection.py
imports: import copy
  from typing import Any
  from towhee.datacollection.entity import Entity
  from towhee.runtime.data_queue import ColumnType
  from towhee.datacollection.mixins.display import DisplayMixin
label_desc: Use image node_id 1 to create a new DataCollection object from inherited base classes: DisplayMixin with example: obj = DataCollection(data)