This is the 198th most frequent Latvian word.
gandrīz
Almost.
The word 'gandrīz' is used here to indicate that the action of completing the book was near to happening but ultimately did not occur.
Es gandrīz pabeidzu grāmatu līdz šim vakaram.
I almost finished the book by tonight.
In this sentence, 'gandrīz' expresses a comparison, implying that the temperature today was very close to that of yesterday but not exactly the same.
Šodien bija gandrīz tikpat auksts kā vakar.
Today was almost as cold as yesterday.
Here, 'gandrīz' conveys a sense of narrowly avoiding an undesired situation, specifically missing the train.