Created
February 2, 2021 08:59
-
-
Save deanjamesss/fef1d932f86ac00344922ed0fdbd20aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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