postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
shorturl | Superuser | {}
postgres=# create database shorturl;
CREATE DATABASE
postgres=# \c shorturl;
You are now connected to database "shorturl" as user "postgres".
shorturl=#
Run Code Online (Sandbox Code Playgroud)
我的偏好是使用数据库shorturl是用户shorturl而不是postgres.我该如何改变呢?
提前致谢.
Data:
qid qualid val
0 1845631864 227 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1 1899053658 44 1,3,3,2,2,2,3,3,4,4,4,5,5,5,5,5,5,5
2 1192887045 197 704
3 1833579269 194 139472
4 1497352469 30 120026,170154,152723,90407,63119,80077,178871,...
Run Code Online (Sandbox Code Playgroud)
Problem:
Numbers separated by commas in column val need to represented in different columns for each row.
I don't know if Pandas allows for it, but ideally, one would want to create exact n number of columns for each row, where n is the number of elements in column val.
If that is not possible, …