I was writing a huge file output.txt (around 10GB) on a server thorugh a python script using the f.write(row) command but because the process was too long I decided to interrupt the program using 
kill -9 pid
The problem is that this space is still used on the server when I check with the command 
df -h
How can I empty the disk occupied by this buffer that was trying to write the file?
the file output.txt was empty (0 Byte) when I killed the script, but I still  deleted it anyway using 
rm output.txt 
but the space in the disk doesn't become free, I still have 10 GB wasted..
If you delete a file which is opened in some processes, it's marked as deleted, but the content remains on disk, so that all processes still can read it. Once all processes close corresponding descriptors (or simply finish), the space will be reclaimed.
Delete an unfinished file