Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

MAINT: update munging #7

Open
wants to merge 5 commits into
base: carbon_flux_notebook
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions examples/Carbon_Flux.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@
" limit = -9990\n",
" for i in range(50):\n",
" df = df.replace(limit - i, np.nan)\n",
" \n",
" i = [col in df.columns for col in drop]\n",
" \n",
" assert all([col in df.columns for col in drop])\n",
Copy link
Collaborator

@jbednar jbednar Jul 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining what this bit does (i.e. what the intention is; here and below)?

" df.drop(columns=drop, inplace=True)\n",
" i = [col in df.columns for col in drop]\n",
" assert not all([col in df.columns for col in drop])\n",
" for col in keep:\n",
" if col not in df.columns:\n",
" if 'SWC_F' in col or 'TS_F' in col:\n",
" df[col] = 0\n",
" \n",
" df = df.fillna(0)\n",
" df['DOY'] = df['TIMESTAMP'].apply(_parse_days) \n",
Expand All @@ -96,8 +100,8 @@
" 'SW_IN_ERA',\n",
" 'LW_IN_ERA',\n",
" 'WS_ERA',\n",
" 'SWC_F_MDS_1', #'SWC_F_MDS_2', 'SWC_F_MDS_3',\n",
" 'TS_F_MDS_1', #'TS_F_MDS_2', 'TS_F_MDS_3',\n",
" 'SWC_F_MDS_1', 'SWC_F_MDS_2', 'SWC_F_MDS_3',\n",
" 'TS_F_MDS_1', 'TS_F_MDS_2', 'TS_F_MDS_3',\n",
" 'VPD_ERA',\n",
" 'DOY']\n",
" drop = [\"GPP_DT_VUT_USTAR50\",\n",
Expand Down