parameters: (self, categories=None)
return_statement: return dtype
docstring: Implied types of the columns in the schema
docstring_summary: Implied types of the columns in the schema
docstring_tokens: Implied types of the columns in the schema
function: def _dtypes(self, categories=None):
          """ Implied types of the columns in the schema """
          import pandas as pd
          if self.has_pandas_metadata:
              md = self.pandas_metadata['columns']
              tz = {c['name']: c['metadata']['timezone'] for c in md
                    if (c.get('metadata', {}) or {}).get('timezone', None)}
          else:
              tz = None
          self.tz = tz
          categories = self.check_categories(categories)
          dtype = OrderedDict((name, (converted_types.typemap(f)
                              if f.num_children in [None, 0] else np.dtype("O")))
                              for name, f in self.schema.root.children.items()
                              if getattr(f, 'isflat', False) is False)
          for i, (col, dt) in enumerate(dtype.copy().items()):
              if dt.kind in ['i', 'b']:
                  # int/bool columns that may have nulls become float columns
                  num_nulls = 0
                  for rg in self.row_groups:
                      chunk = rg.columns[i]
                      if chunk.meta_data.statistics is None:
                          num_nulls = True
                          break
                      if chunk.meta_data.statistics.null_count is None:
                          num_nulls = True
                          break
                      if chunk.meta_data.statistics.null_count:
                          num_nulls = True
                          break
                  if num_nulls:
                      if dtype[col].itemsize == 1:
                          dtype[col] = np.dtype('f2')
                      elif dtype[col].itemsize == 2:
                          dtype[col] = np.dtype('f4')
                      else:
                          dtype[col] = np.dtype('f8')
              elif dt.kind == "M":
                  if tz is not None and tz.get(col, False):
                      dtype[col] = pd.Series([], dtype='M8[ns]'
                                             ).dt.tz_localize(tz[col]).dtype
              elif dt == 'S12':
                  dtype[col] = 'M8[ns]'
          for field in categories:
              dtype[field] = 'category'
          for cat in self.cats:
              dtype[cat] = "category"
          self.dtypes = dtype
          return dtype
function_tokens: def _dtypes ( self , categories = None ) : import pandas as pd if self . has_pandas_metadata : md = self . pandas_metadata [ 'columns' ] tz = { c [ 'name' ] : c [ 'metadata' ] [ 'timezone' ] for c in md if ( c . get ( 'metadata' , { } ) or { } ) . get ( 'timezone' , None ) } else : tz = None self . tz = tz categories = self . check_categories ( categories ) dtype = OrderedDict ( ( name , ( converted_types . typemap ( f ) if f . num_children in [ None , 0 ] else np . dtype ( "O" ) ) ) for name , f in self . schema . root . children . items ( ) if getattr ( f , 'isflat' , False ) is False ) for i , ( col , dt ) in enumerate ( dtype . copy ( ) . items ( ) ) : if dt . kind in [ 'i' , 'b' ] : # int/bool columns that may have nulls become float columns num_nulls = 0 for rg in self . row_groups : chunk = rg . columns [ i ] if chunk . meta_data . statistics is None : num_nulls = True break if chunk . meta_data . statistics . null_count is None : num_nulls = True break if chunk . meta_data . statistics . null_count : num_nulls = True break if num_nulls : if dtype [ col ] . itemsize == 1 : dtype [ col ] = np . dtype ( 'f2' ) elif dtype [ col ] . itemsize == 2 : dtype [ col ] = np . dtype ( 'f4' ) else : dtype [ col ] = np . dtype ( 'f8' ) elif dt . kind == "M" : if tz is not None and tz . get ( col , False ) : dtype [ col ] = pd . Series ( [ ] , dtype = 'M8[ns]' ) . dt . tz_localize ( tz [ col ] ) . dtype elif dt == 'S12' : dtype [ col ] = 'M8[ns]' for field in categories : dtype [ field ] = 'category' for cat in self . cats : dtype [ cat ] = "category" self . dtypes = dtype return dtype