class_docstr: Scales the data so that it has zero mean and unit variance.
  
  Under the hood, a running mean and a running variance are maintained. The scaling is slightly
  different than when scaling the data in batch because the exact means and variances are not
  known in advance. However, this doesn't have a detrimental impact on performance in the long
  run.
  
  This transformer supports mini-batches as well as single instances. In the mini-batch case, the
  number of columns and the ordering of the columns are allowed to change between subsequent
  calls. In other words, this transformer will keep working even if you add and/or remove
  features every time you call `learn_many` and `transform_many`.
  
  Parameters
  ----------
  with_std
      Whether or not each feature should be divided by its standard deviation.
  
  Examples
  --------
  
  >>> import random
  >>> from river import preprocessing
  
  >>> random.seed(42)
  >>> X = [{'x': random.uniform(8, 12), 'y': random.uniform(8, 12)} for _ in range(6)]
  >>> for x in X:
  ...     print(x)
  {'x': 10.557, 'y': 8.100}
  {'x': 9.100, 'y': 8.892}
  {'x': 10.945, 'y': 10.706}
  {'x': 11.568, 'y': 8.347}
  {'x': 9.687, 'y': 8.119}
  {'x': 8.874, 'y': 10.021}
  
  >>> scaler = preprocessing.StandardScaler()
  
  >>> for x in X:
  ...     scaler.learn_one(x)
  ...     print(scaler.transform_one(x))
  {'x': 0.0, 'y': 0.0}
  {'x': -0.999, 'y': 0.999}
  {'x': 0.937, 'y': 1.350}
  {'x': 1.129, 'y': -0.651}
  {'x': -0.776, 'y': -0.729}
  {'x': -1.274, 'y': 0.992}
  
  This transformer also supports mini-batch updates. You can call `learn_many` and provide a
  `pandas.DataFrame`:
  
  >>> import pandas as pd
  >>> X = pd.DataFrame.from_dict(X)
  
  >>> scaler = preprocessing.StandardScaler()
  >>> scaler.learn_many(X[:3])
  >>> scaler.learn_many(X[3:])
  
  You can then call `transform_many` to scale a mini-batch of features:
  
  >>> scaler.transform_many(X)
      x         y
  0  0.444600 -0.933384
  1 -1.044259 -0.138809
  2  0.841106  1.679208
  3  1.477301 -0.685117
  4 -0.444084 -0.914195
  5 -1.274664  0.992296
  
  References
  ----------
  [^1]: [Welford's Method (and Friends)](https://www.embeddedrelated.com/showarticle/785.php)
  [^2]: [Batch updates for simple statistics](https://notmatthancock.github.io/2017/03/23/simple-batch-stat-updates.html)
class_docstr_tok: ["Scales","the","data","so","that","it","has","zero","mean","and","unit","variance",".","Under","the","hood",",","a","running","mean","and","a","running","variance","are","maintained",".","The","scaling","is","slightly","different","than","when","scaling","the","data","in","batch","because","the","exact","means","and","variances","are","not","known","in","advance",".","However",",","this","does","n't","have","a","detrimental","impact","on","performance","in","the","long","run",".","This","transformer","supports","mini-batches","as","well","as","single","instances",".","In","the","mini-batch","case",",","the","number","of","columns","and","the","ordering","of","the","columns","are","allowed","to","change","between","subsequent","calls",".","In","other","words",",","this","transformer","will","keep","working","even","if","you","add","and\/or","remove","features","every","time","you","call","`","learn_many","`","and","`","transform_many","`",".","Parameters","--","--","--","--","--","with_std","Whether","or","not","each","feature","should","be","divided","by","its","standard","deviation",".","Examples","--","--","--","--",">",">",">","import","random",">",">",">","from","river","import","preprocessing",">",">",">","random.seed","(","42",")",">",">",">","X","=","[","{","'","x","'",":","random.uniform","(","8",",","12",")",",","'","y","'",":","random.uniform","(","8",",","12",")","}","for","_","in","range","(","6",")","]",">",">",">","for","x","in","X",":","...","print","(","x",")","{","'","x","'",":","10.557",",","'","y","'",":","8.100","}","{","'","x","'",":","9.100",",","'","y","'",":","8.892","}","{","'","x","'",":","10.945",",","'","y","'",":","10.706","}","{","'","x","'",":","11.568",",","'","y","'",":","8.347","}","{","'","x","'",":","9.687",",","'","y","'",":","8.119","}","{","'","x","'",":","8.874",",","'","y","'",":","10.021","}",">",">",">","scaler","=","preprocessing.StandardScaler","(",")",">",">",">","for","x","in","X",":","...","scaler.learn_one","(","x",")","...","print","(","scaler.transform_one","(","x",")",")","{","'","x","'",":","0.0",",","'","y","'",":","0.0","}","{","'","x","'",":","-0.999",",","'","y","'",":","0.999","}","{","'","x","'",":","0.937",",","'","y","'",":","1.350","}","{","'","x","'",":","1.129",",","'","y","'",":","-0.651","}","{","'","x","'",":","-0.776",",","'","y","'",":","-0.729","}","{","'","x","'",":","-1.274",",","'","y","'",":","0.992","}","This","transformer","also","supports","mini-batch","updates",".","You","can","call","`","learn_many","`","and","provide","a","`","pandas.DataFrame","`",":",">",">",">","import","pandas","as","pd",">",">",">","X","=","pd.DataFrame.from_dict","(","X",")",">",">",">","scaler","=","preprocessing.StandardScaler","(",")",">",">",">","scaler.learn_many","(","X","[",":3","]",")",">",">",">","scaler.learn_many","(","X","[","3",":","]",")","You","can","then","call","`","transform_many","`","to","scale","a","mini-batch","of","features",":",">",">",">","scaler.transform_many","(","X",")","x","y","0","0.444600","-0.933384","1","-1.044259","-0.138809","2","0.841106","1.679208","3","1.477301","-0.685117","4","-0.444084","-0.914195","5","-1.274664","0.992296","References","--","--","--","--","--","[","^1","]",":","[","Welford","'s","Method","(","and","Friends",")","]","(","https",":","\/\/www.embeddedrelated.com\/showarticle\/785.php",")","[","^2","]",":","[","Batch","updates","for","simple","statistics","]","(","https",":","\/\/notmatthancock.github.io\/2017\/03\/23\/simple-batch-stat-updates.html",")"]
code: def transform_one(self, x):
      if self.with_std:
          return {
              i: safe_div(xi - self.means[i], self.vars[i] ** 0.5)
              for i, xi in x.items()
          }
      return {i: xi - self.means[i] for i, xi in x.items()}
  
imports: from __future__ import annotations
  import collections
  import functools
  import itertools
  import numbers
  import numpy
  import pandas
  from river import base, stats, utils
label_desc: Use image node_id 3 for calling the StandardScaler obj's underlying member method code with example usage: obj.transform_one(x) and returns: unknown, unknown