This is a so-called "invalid state", because the sign is not meant to be there in a normal situation. So you always have to abuse a bug or external editor to get it there and then be careful to not change anything on any of the six adjacent blocks ever again.

**With commands**, you can just use `/setblock`, because it doesn't update the block ([MC-31100](https://bugs.mojang.com/browse/MC-31100)). But you have to specify everything about the sign. The one in your example can be set like this:

    /setblock ~ ~ ~ wall_sign[facing:north]{Text1:"",Text2:"This is a",Text3:"floating sign",Text4:""}

You  have to replace the `north` with `south`, `east` or `west` for the other directions.  
You may have to have all four "Text" tags for it to work. The wiki says that, but I didn't test it.

**Without commands**, you'll likely have to use stack overflows for update suppression, since most other bugs that do it are fixed. For that, you can for example use a machine like [here](https://www.youtube.com/watch?v=mzfLHNeqjuY). But you'll likely have to experiment a lot with it, since 1.13 also changed something in that regard and 1.14 will change even more.