how apply ETS model to multiple rows - function

I have a doubt about a similar DataFrame like this:
enter image description here
and I want to assign ETS models by column, I create an example
data=Gasto_NUTAG['NUTAG201Comunicaciones']
model=ETSModel(data, error='add',trend='add',damped_trend=True)
results=model.fit()
forecasts=results.forecast(4)
forecasts
enter image description here
Resultados_pred=[]
for i in range(len(prueba)):
DATA=prueba.iloc[i]
DATA=np.array(DATA).reshape(-1,1)
model=ETSModel(apilar, error='add',trend='add',damped_trend=True)
#results=model.fit()
#forecasts=results.forecast(4)
#Resultados_ETS=Resultados_pred.append(forecasts)
But it doesn't work, any idea?
Thanks :)

Related

How to use where clause to get the output on the basis of the length of Character's in it

So the thing is that I have the following question:
Display the column Brand from the table clothing where length(Brand)=10.
So I used the query: select Brand from clothing where length(Brand)=10;
This gives me the out put as an empty set, so I checked my table to see if it was actually supposed to give an empty set and the answer was no.
So if anyone would be able to tell what's going wrong then that would be of great help
The images for the table and the input I tried are given below.
Table image and the input I gave

How to display default text if image field value is null in database in SSRS?

so I'm creating a report that contains an image field which gets its value from the database. What I'm trying to achieve is to display simple text saying "No image found!" in place of the image if its field value is null or blank in the database. Following is the expression I've written :-
=iif(IsNothing(Fields!EmployeeImage.Value) Or Fields!EmployeeImage.Value = "","No image found!",Fields!EmployeeImage.Value)
Would really appreciate it if someone can help or guide me in the right direction.
When I have done htis in the past, I have stored an image called 'NoImage.png' for exmaple. The noimage image it the typical image you see, something like this.
Then you just need to point to this image if none is found. I usually do this in the database itself.

How to make series subform in the main form by (infinity)adding button?

This is the idea what I would like to get it. I am using Access-VBA but I am struggling to make series like this. Could you please give me an idea how to proceed it.
Thank you in advance.
EDIT 2
How to hide second form like this?
Edit 3
Ok let me make a clear picture.
Imagine that you have one form which requires to enter family member's data for each family. So different family has different number of members. Some family has 5, some has 4 ...
The default page shows only one form for one person so it's |family 1| = area. This form also requires to fill "name/last name/address/whatever..." = width/lenght/xxx for the first person. And then second one needs to be added with the same form "name/last name/address/whatever..." AGAIN by clicking "+" sign until it covers the whole members.
Then second family members also needs the same.

Using Cutsom Colors For Charts and Tablix in SSRS

So I have been tasked with creating this.
I have the charts in the tablix and I have created a custom pallete that is not implemented yet, this is just the sea green pallete, but I need to color the rectangles in the description so they match the charts like this.
I am thinking maybe a code function that looks at the row and assigns color dynamically the only problem is there is not a static number of rows and the description columns will not always be the same.
Just looking for some ideas thank you in advance.
I would go with a Code Function that accepts the series/row name and returns the color (as a string). I would probably code it as one big "Select Case True" statement, e.g.
https://stackoverflow.com/a/794091/1787137
Within each Case statement I would code for the variations in the description columns, using Like or .Contains.

Handling Multiple Images with ColdFusion and MySQL

This is an architecture question, but its solution lies in ColdFusion and MySQL structure--or at least I believe so.
I have a products table in my database, and each product can have any number of screen-shots. My current method to display product screen-shots is the following:
I have a single folder where all screen-shots associated with all products are contained. All screen-shots are named exactly the same as their productID in the database, plus a prefix.
For example: Screen-shots of a product whose productID is 15 are found in the folder images, with the name 15_screen1.jpg, 15_screen2.jpg, etc...
In my ColdFusion page I have hard-coded the image path into the HTML (images/); the image name is broken into two parts; part one is dynamically generated using the productID from the query; and part two is a prefix, and is hard-coded. For example:
<img src"/images/#QueryName.productID#_screen1.jpg">
<img src"/images/#QueryName.productID#_screen2.jpg"> etc...
This method works, but it has several limitations the biggest listed bellow:
I have to hard-code the exact number of screen-shots in my HTML template. This means the number of screen shots I can display will always be the same. This does not work if one product has 10 screen shots, and another has 5.
I have to hard-code image prefixes into my HTML. For example, I can have up to five types of screen-shots associated with one product: productID=15 may have 15_screen1.jpg, 15_screen2.jpg, and 15_FrontCover.jpg, 15_BackCover.jpg, and 15_Backthumb.jpg, etc...
I thought about creating a paths column in my products table, but that meant creating several hundreds of folders for each product, something that also does not seem efficient.
Does anyone have any suggestions or ideas on the correct method to approach this problem?
Many thanks!
How about...
use an Image table, one product to many images (with optional sortOrder column?), and use imageID as the jpeg file name?
update:
Have a ImageClass table, many Image to one ImageClass.
Image
-----
ID
productID
imageClassID (FK to ImageClass)
Use back-end business logic to enforce the some classes can only have one image.
Or... if you really want to enforce some classes can only one image, then can go for a more complex design:
Product
------
ID
name
...
frontCoverImageID
backCoverImageID
frontThumbImageID
backThumbImageID
Image
-----
ID
productID
isScreenShot (bit) // optional, but easier to query later...
However, I like the first one better since you can have as many classes you see fit later, without refactoring the DB.
Keeping information on how many and what images in the database is definitely the way to go.
Barring that, if you want to use naming conventions to associate images with products, and the number of images is arbitrary, then it's probably a better idea to create one folder per product:
/images/products/{SKU1}/frontview.jpg
/images/products/{SKU1}/sideview.jpg
/images/products/{SKU2}/frontview.jpg
and so forth. Then use <cfdirectory> to collect the images for a given product. You might also want to name your images 00_frontview.jpg, 01_sideview.jpg and such so that you can sort and control what order they'll display on the page.
use the cfdirectory tags to inspect the filesystem:
<!--- get a query resultset of images in filesystem --->
<cfdirectory action="list" name="images" directory="images">
<!--- get images for specific product --->
<cfquery name="productImages" dbtype="query">
select *
from images
where name like '#productid#%'
</cfquery>
<cfoutput query="productImages">
<img src="#productimages.directory#/#productimages.name#" />
</cfoutput>
You could even try using the filter attribute to cfdirectory to try and omit the QoQ