Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
127 views
in Technique[技术] by (71.8m points)

python - Turning strings into integers for a lineplot

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

dataset of vision changes over time

question from:https://stackoverflow.com/questions/65943238/turning-strings-into-integers-for-a-lineplot

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...