The function replaces each alphabetical character in the input string with its position in the alphabet, starting from 0 for 'a', 1 for 'b', etc., and discards non-alphabetical characters.

[CODE]:
```python
def f(x):
    result = []
    for char in x:
        if char.isalpha():
            result.append(str(ord(char.lower()) - ord('a')))
    return ' '.join(result)
```