Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Last active March 27, 2021 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AyishaR/19d3d56da11ed0b5f8fbb2c89d6635bd to your computer and use it in GitHub Desktop.
Save AyishaR/19d3d56da11ed0b5f8fbb2c89d6635bd to your computer and use it in GitHub Desktop.
df = df.sort_values('gas_type')
temp_inside = []
for t in df['gas_type'].unique():
temp_inside.extend(df[df['gas_type']==t]['temp_inside'].fillna(df[df['gas_type']==t]['temp_inside'].mode()[0]))
df['temp_inside'] = temp_inside
df['refill liters'] = df['refill liters'].fillna('0')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment