code: def from_dict(data: dict) -> pd.DataFrame:
      """Convert a dict into a pandas dataframe.
      This function is faster than pd.from_dict (01/02/2021).
  
      Parameters
      ----------
      data
          Input data as dict.
  
      Returns
      --------
          Dict to pandas dataframe.
  
      """
      dict_data, index = list(data.values()), list(data.keys())
      return pd.DataFrame(data=dict_data, index=index, dtype="float32")
  
file_path: river/river/naive_bayes/base.py
imports: from __future__ import annotations
  import abc
  import math
  import numpy
  import pandas
  from scipy import sparse, special
  from river import base
label_desc: Use image node_id 1 for calling a global function with example usage: from_dict(data) and returns: pd