Skip to content

Instantly share code, notes, and snippets.

@deanjamesss
Created February 2, 2021 08:59
Show Gist options
  • Save deanjamesss/fef1d932f86ac00344922ed0fdbd20aa to your computer and use it in GitHub Desktop.
Save deanjamesss/fef1d932f86ac00344922ed0fdbd20aa to your computer and use it in GitHub Desktop.
import pandas as pd
def double_number(x):
""" Double a passed float
:param x: Float that will be doubled.
:return: A doubled float.
"""
return float(x) * 2
if __name__ == '__main__':
# Apply a converter to column 1.
df = pd.read_csv('test.csv', header=0, converters={'col1': double_number})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment