In trying to depict change in vision over time using Python's seaborn lineplot, two problems presented themselves.
Firstly, the data representing a person's vision at a given point in time is not in the form of an integer, as seen below in the dataset. It is a string in the form of a fraction, with the distance at which the letter is read as the numerator and the distance at which it ought to be read as the denominator (for example 20/20 being good and 20/100 worse). NLP (no light perception) is the worst possible outcome, while LP (light perception) is next best. In cases where the vision is so low that no letters can be made out, HM is used for the ability to see Hand Movement, followed by CF for Counting Fingers. The symbol n/a is assumed to mean the patient was not available.
Second, the way that time is represented in the columns: VA before K pro (Visual Acuity before surgery), VA 0-30d (Visual Acuity 0 - 30 days) etc.
How do I turn these values into integers so I can depict the change in vision over time with a seaborn lineplot? I would like the VA data on the y axis and Time on the x axis so as to depict a decrease in vision over time.
I appreciate the help
question from:
https://stackoverflow.com/questions/65943238/turning-strings-into-integers-for-a-lineplot 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…