Skip to content

Tag: dataframe

Adding Sparkline to Pandas Dataframe

I would like to draw and append sparklines to my dataframe. I have worked through a bunch of examples which ended up running into Base64 encoded output. I was hoping to use a simple approach, perhaps using matplotlib. I need to visualise linecharts for each row, I am unsure whether a plt figure can be appende…

Divide dataframe column by a specific cell

I want to divide a dataframe column by a specific cell in the same dataframe. I have a dataframe like this: I want to compute the score_ratio by dividing the score by the ‘baseline’ score of that date. The score_ratio for (date, type) = (20201101, experiment1) should be obtained by dividing its sc…

Reading a CSV from a particular line

I am writing a program working on weather station’s data, and this is the CSV I get from my station: The issue is that pandas has troubles opening it. First, I had an error message that I managed to bypass by writing: Now the other issue is that the pandas file only displays the first 4 lines: The CSV c…