<human>:  space to underscore function.
<bot>: Here is a Python function to space to underscore the space

import pandas as pd

def space_to_underscore(s):
  """Convert space to underscore."""
  return s.replace(" ", "_")

# Enter the string
s = "Hello world"

# Calling the function
print((space_to_underscore(s)))

#Example Output
# Hello__world

#Remember to inspect code for bugs.