小编Abh*_*han的帖子

你如何在PostgreSQL中更改用户?

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.我该如何改变呢?

提前致谢.

postgresql psql

6
推荐指数
2
解决办法
1万
查看次数

Pandas DataFrame - Creating dynamic number of columns

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, …

python database numpy dataframe pandas

1
推荐指数
1
解决办法
1185
查看次数

标签 统计

database ×1

dataframe ×1

numpy ×1

pandas ×1

postgresql ×1

psql ×1

python ×1