Evaluating a dataset on Openscale returns "column needs to be double" error - ibm-watson

I'm trying to evaluate this dataset and keep getting an error saying that a column needs to be double, but when I check it it's a float, which should be the same thing in Python 3 (?)
import pandas as pd
df = pd.read_csv('./undefinedweatherAUS_processed.csv')
df.RainToday
0 1.0
1 1.0
2 1.0
3 1.0
4 1.0
...
120376 1.0
120377 1.0
120378 1.0
120379 1.0
120380 1.0
Name: RainToday, Length: 120381, dtype: float64
Am I missing something or is this a bug?
Update: I was accessing the data from the Cloud Object Storage, which returned that error, now I tried uploading a smaller version of the same dataset and it seemed to work. So the problem seems to be in the communication between COS and Openscale

Related

Convert varchar to integer from substring

using Microsoft SQL Server 2019
So I have parsed out several columns from a large text field and will need to use the parsed data as a multiplier to other fields
here is a single parsed column mostly for context
SUBSTRING(curv.curv_data,
CHARINDEX('PctUsage', curv.curv_data, CHARINDEX('||1', curv.curv_data)) + 9,
(CHARINDEX(')())', curv.curv_data, CHARINDEX('PctUsage', curv.curv_data, CHARINDEX('||2', curv.curv_data))) - 9) - CHARINDEX('PctUsage', curv.curv_data, CHARINDEX('||1', curv.curv_data) + 9)) PctUsage1
Here is the output.
PctUsage1
5
3.5
0.5
6.5
5
9
1
1.3
1.5
25.
4
0.0
1.2
so given there are 0s and 0.5 I am having a hard time turning this column into something useful. the end result I would like is to turn these into usable percentages for example 5 turns into .05 and so on.
I am going to be using the SQL above in a sub-select that will then be used as a multiplier for my working hours field here is an example of my multiplier field
Working_hours
51.600006
0.000000
20.799993
8.399999
28.799999
86.027731
5.199999
This is the line I would like to be able to use
PctUsage1*Working_hours curved_hours,
So working_hours is an Integer already but Pctusage1 is a varchar
Thank you in advance for the help
Okay so i think i have a solution, sorry for any of the trouble you guys have taken i guess writing out my problem really helped me work through it. i used a case statement with try_cast that helped filter out the different problems i was having with using only one solution. the last problem with this is making sure my multiplier is correct for that i had to use CHARINDEX with an imbedded case statement
case when try_cast(PctUsage1 as int) is null then case when CHARINDEX('.',PctUsage1) = 3 then cast(replace(PctUsage1, '.','') as Decimal(5,2))/100 when CHARINDEX('.',PctUsage1) = 2 then cast(replace(PctUsage1, '.','') as Decimal(5,2))/1000 end else try_cast(PctUsage1 as decimal(5,2))/100 end PctUsage1_converted,

SPSS: How to get the range of b standard erorr ± of coefficient in logistic regression?

I did a binary logistic regression and in the output (in the saction "Variables in the equation") I find the B coefficient and its standard error (ex S.E. = .859). However, I need the range of the beta standard erorr, somthing like: beta ± SE 0.05 ± 0.09.
How can I get Spss to show this value in the output or compute this value on my own?
You can get the data from the output table into a new dataset - using OMS command, then you can use it to make calculations:
DATASET DECLARE mydata.
OMS /SELECT TABLES
/IF COMMANDS=['Logistic Regression'] SUBTYPES=['Variables in the Equation']
/DESTINATION FORMAT=SAV OUTFILE='mydata' .
*run your analysis here.
omsend.
dataset activate mydata.

google data studio - i get incorrect value when i do a multiplication on CPC

My problem is the value of CPC displayed after a multiplication "not correct"
Example : my CPC = 0.02 $
and i want to multiply the CPC by 10.5
i tried to do CPC * 10.5 but the result is 0.17 instead of 0.21
For information : i get data from google ads
thank you a lot in advance
The Decimal Precision in Scorecards is set to 2 places by default, thus one possibility is that the value of 0.02 in the CPC moy field is rounded from 0.0165.
Google Data Studio Report and a GIF to elaborate:

Proj4 Oblique Mercator giving strange results when alpha is between 90 and 270 inclusive

I have the following proj4 projection string defining an Oblique Mercator projection :
+proj=omerc +lat_0=45 +lonc=-80 +x_0=0 +y_0=0 +alpha=45 +gamma=0 +k_0=1
For my input coordinate, I was using 0, 0. When I alter the alpha angle from 45 to the range 90 to 270 inclusive, the projected point changes from the expected 80W, 45N to a point that proceeds easterly around the earth at the same latitude until the alpha is > 270, where I then get expected results again.
invproj +proj=omerc +lat_0=45 +lonc=-80 +x_0=0 +y_0=0 +alpha=45 +gamma=0 +k_0=1
0 0
80dW 45dN (this is expected)
invproj +proj=omerc +lat_0=45 +lonc=-80 +x_0=0 +y_0=0 +alpha=89 +gamma=0 +k_0=1
0 0
80dW 45dN (this is expected)
invproj +proj=omerc +lat_0=45 +lonc=-80 +x_0=0 +y_0=0 +alpha=91 +gamma=0 +k_0=1
0 0
77d10'18.699"W 45dN (this is not expected)
I'm not sure why I should be getting these different results, as a workaround, I could reverse the angle from 91 to 271, but I think I might need to also reverse the u, v in the projected system, it would be nice if Proj4 did this.
Is specifying alpha from 90-270 not supported?
Or, is there something I need to do with my parameters?
Edit: I've created an issue at Github for this at : https://github.com/OSGeo/proj.4/issues/331
It looks like there was a regression between Proj4 versions 4.7 and 4.8 that introduced a bug for this scenario, I found the following in the mailing list archives:
http://lists.maptools.org/pipermail/proj/2012-June/006331.html
Mikael Rittri wrote :
Not what I would expect. As far as I can understand, these weird results appear when alpha
is southish (in the closed interval 90 to 270). The omerc of Proj 4.7.0 did not behave this way.
This coincides with my observations. My solution was to reverse the alpha and add a pre/post processing layer that inverses the sign of the easting and northing values.

Formatting numbers according to input precision

I have an SSRS report pulling data in from a column of type DECIMAL(9,3). I want to display these values to the number of decimal places used to enter the data into the system.
For example:
Data Output
------- -------
123.456 123.456
123.450 123.45
123.400 123.4
123.006 123.006
120.000 123
120.000 120
100.000 100
I know you can format numeric data to a specific number of decimal places using the Format property for the column (e.g. N3 for 3dp), and I know that in C# the format string "{0:###}" would achieve the desired result.
I feel like it should be easy to do, but so far I've not found the right syntax to combine the two concepts in SSRS. What am I missing?
You can use the 0.### mask. In this case, it will produce the following results:
0.510 -> 0.51
6.581 -> 6.581
9.10 -> 9.1
Just checked it, works on SSRS 2008/2008 R2.

Resources