python - How can I write this syntax if there is space in column name? -


how can write syntax if there space in column name "image_path"? instead of "image_path", have "image path". changed column name works. however, wondering if there way can write syntax without changing column name "image path" "image_path".

(df.groupby('content_type').image_path.nunique()) 

thank you, shone

edit: in case answer below deleted:

df.groupby('content_type')['image path'].nunique() 

use [...] indexer string:

df.groupby('content_type')['image path'].nunique() 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -