A:
You can use the package discography:
> library(discography)
> data(Discography)
> search(Discography, "The Beatles")
> data(Discography)
> search(Discography, "The Beatles")
Discography with 273 pages
Q:
Weird exception message from appending an html element to a list
I'm trying to append an html element into a list of cms items and have it come out as a list item. I'm doing this using a div wrapper in the cms template:
{{ cms_item_list.append(item, item_id=item_id) }}
However, the exception message I'm getting has me puzzled:
Unsupported widget type
If I understand correctly, that means that the format of the content of the div is different than that of the fields format.
Is there a way to get the "list" output to appear without having to add a new field?
A:
You can either add a new field, or change the type of your existing field.
Q:
How to use a variable in the name of a pandas column?
I'm working on a data frame where I want to concatenate a pandas string column to another column's name and a variable. This variable is an int (called temp). When I try the following
df.loc[:, '**' + str(temp) + '**']: ['XXX', 'XXX']
It says TypeError: unsupported operand type(s) for +: 'int' and'str'.
I understand that this may be because I'm trying to add an int to a string column, but I have no idea how to get around this. What I want to do is to get the name of a column with a variable as a suffix, like this:
df.loc[:, '**' + str(temp) + '**']: ['XXX', 'XXX']
The problem is that it doesn't work.
If I use
df.loc[:, '**' + str(temp) + '**']: ['XXX', 'XXX']
or even
df.loc[:, '**' + str(temp) + '**']: [' be359ba680
Related links:
Comments