'DataFrame' object has no attribute 'label',how can I add label? - dataframe

I created a .csv which shows below, and when I try to use the label it told me"'DataFrame' object has no attribute 'label'",the code is as follows
why my columns "cd,cs,cf" is not labels?enter image description here
I wish I input "aiya.label" it could turns out cd,cs,cf

Related

How to extract hyperlink from html anchor tag in pandas

We have a field in dataframe having value as -
Twitter for iPhone
I need to extract only http://twitter.com/download/iphone in pandas,
I tried using -
twitter_archive['source'].find('a')
to get starting index position, but its giving error :
'Series' object has no attribute 'find'
How we can achieve this ?
This worked for me to extract domain name.
twitter_archive['source'].str.split("/").str[2]

How to create a range picker for a variable in Qlik?

I'm new to Qliksense and I would like to select and visualise all datapoints in my table based on the value of a variable called NoOfPersons, similar to the date-range picker. How can I do this? I have attached a sample image below:
Under the Custom Objects the Qlik Dashboard bundle select the variable input object
Then under the variable options select the slider option
I don't know how to make it look like your example but it will provide the functionality you want

Prestashop1.6 Change Default Product thickbox with watermark

In product.tpl i managed to change the default size of thickbox by editing this code
href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}"
to
href="{$link->getImageLink($product->link_rewrite, $imageIds, '')|escape:'html':'UTF-8'}"
now the problem is the watermark is not working, Note that i used prestashops default watermark module.
prestashop provides a feature called image types where we can created custom image type with providing width, height and the image type is used for (category, product,manufacture etc..) and we can use this image type in tpl or php codes wherever required.
Watermark module draws the watermark for all image types except original image. So for your case we can create a new image type called custom_default and we can use this in your tpl file
getImageLink($name, $ids, $type = null)
getimagelink method accepts 3 parameters and the 3rd param is for image type and not required and is null by default. So if we pass the 3rd param the image with the provided type will be returned otherwise original image will be returned. So just modify your tpl code by passing our new image type as the value for 3rd param
href="{$link->getImageLink($product->link_rewrite, $imageIds, 'custom_default')|escape:'html':'UTF-8'}"

Vue.js $set on array element does not trigger notification

I have a Vue instance whose data contains an array of objects. I display this data in a table without issue.
Upon clicking the table rows, I set a "selected" property on the corresponding data object using:
key.$set('testing', testing);
Upon setting this value, I add a custom css class the the table row, without issue.
However, if I do a simple output of the entire array of objects at the bottom of the page (such as below), it doesn't get updated to reflect the new "testing" attribute I have added.
{{ gridData | json }}
I was able to reproduce my question using some modified vue.js example code in this JSFiddle:
https://jsfiddle.net/wdmatl/531axrtt/
Notice when you click on rows of data, you either see "testing" or "not testing". But this new object data isn't reflected in the json at the bottom of the page. Why not?

How to get all input having the same class, id name in Controller - Laravel 5?

I have function which appends new answer inputs when 'Add answer' button is clicked. In Controller, i want to get the value of all answer inputs with id or class.
Here is the code I am currently using:
<script>
var txt1 = '{!! Form::text('answer1',null,['class' => 'answer']) !!}';
$(document).on('click','#btn1',function(){
$(this).before(txt1);
});
</script>
In Controller, I'm using this:
$input['answer_body'] = Input::get('answer1');
I can get one value according to one id in Laravel, but now i need to get all values that have same id and class.
Could anybody help me?
You can't, the ID and class aren't submitted and so aren't available in the PHP. What you can do is get results by the same name by turning them into an array. Change Form::text('answer1', to Form::text('answer1[]' so that you can submit multiple inputs with the same name.
If you then use $input['answer_body'] = Input::get('answer1');, $input['answer_body'] will have an array in it. You can get specific answers by using dot notation to specify which input you want to get, e.g.: Input::get('answer1.0'); will fetch the value in the first input with a name of answer1[].