CREATE OR REPLACE FUNCTION pg_temp.my_func(text)
RETURNS table (city_nm text, name text) AS
$BODY$
WITH city (city_nm, name) AS (
VALUES
('Москва','Петр')
,('Москва','Иван')
,('Москва','Ира')
,('Сочи','Алена')
,('Сочи','Миша')
,('Сочи','Олег')
)
SELECT * FROM city WHERE city_nm = $1
$BODY$
LANGUAGE 'sql' VOLATILE
WITH city (city_nm, name) AS (
VALUES
('Москва','Петр')
,('Москва','Иван')
,('Москва','Ира')
,('Сочи','Алена')
,('Сочи','Миша')
,('Сочи','Олег')
)
SELECT
DISTINCT C.city_nm
,N.Name
FROM city C
INNER JOIN (SELECT FROM pg_temp.my_func(C.city_nm)) N
USING (city_nm)
df['phone'] = df['phone'].str[1:]
Free accounts' internet access goes via a proxy "whitelist". Here is the list of sites currently allowed:
https://www.pythonanywhere.com/whitelist/
We operate this to prevent malicious users from using our site to hack into and spam other websites. Paid-for accounts don't have this limitation, because we can connect them to real people. Spammers and criminals prefer to be anonymous, so we figure they're unlikely to sign up for paid accounts here.