MCPcopy Create free account
hub / github.com/NatLabRockies/windtools / _get_fieldnames

Function _get_fieldnames

windtools/plotting.py:1656–1670  ·  view source on GitHub ↗

Return list of fieldnames in df

(df)

Source from the content-addressed store, hash-verified

1654
1655
1656def _get_fieldnames(df):
1657 """
1658 Return list of fieldnames in df
1659 """
1660 if isinstance(df,pd.DataFrame):
1661 fieldnames = list(df.columns)
1662 # Remove any column corresponding to
1663 # a dimension (time, height or frequency)
1664 for dim in dimension_names.keys():
1665 name, axis = _get_dim(df,dim)
1666 if axis==1:
1667 fieldnames.remove(name)
1668 return fieldnames
1669 elif isinstance(df,pd.Series):
1670 return [df.name,]
1671
1672
1673def _contains_field(df,fieldname):

Callers 1

_check_consistencyMethod · 0.85

Calls 1

_get_dimFunction · 0.85

Tested by

no test coverage detected