Identifying what's wrong with my code

时间:2017-08-30 20:20:15

标签: python pandas sqlite

What i'm trying to do is to create a new column that will tell me each country's population in 2015.

The columns of the DF are:

SELECT 
t1.PatientID,
t1.FullName,
t1.CurrentRAF_DW,
t1.NumberOfCompletedClinicVisits,
t1.PreferredServiceLocation,
case when t1.IsVip = 1 then 'Yes' else 'No' end as [IsVip], 
case when t1.PatientTier = 'Critical' then 'Every Three Weeks' 
     when t1.PatientTier = 'Serious' then 'Every 1 Month'
     when t1.PatientTier = 'Fair' then 'Every 2 Months'
     when t1.PatientTier = 'Good' then 'Every 3 Months'
else ' '    
end as [Cadence],
t1.PatientTier,
t2.hcc_18,
t2.hcc_19,
t2.hcc_21,
t2.hcc_22,
t2.hcc_12,
t2.hcc_136,
t2.hcc_137,
t2.hcc_108,
t2.hcc_88,
t2.hcc_111,
t2.hcc_85,
t2.hcc_55,
t1.LastCompletedClinicVisit,
case when t1.NextScheduledClinicVisit is not null then t1.NextScheduledClinicVisit else 'No Next Appointment' end as [NextScheduledVisit]
FROM vw_patient_attributes t1
INNER JOIN STG_OSHODS_DW.osh_rpt.dim_member_care_measures t2
    ON t1.PatientID = t2.emr_id

Here it is guys:

public void setPrefIntArray(String tag, int[] value)
{
    SharedPreferences.Editor prefEditor = PreferenceManager.getDefaultSharedPreferences(context)
            .edit();

    String s;
    try
    {
        JSONArray jsonArr = new JSONArray();
        for (int i : value)
            jsonArr.put(i);

        JSONObject json = new JSONObject();
        json.put(tag, jsonArr);

        s = json.toString();
    }
    catch(JSONException excp)
    {
        s = "";
    }

    prefEditor.putString(tag, s);
    prefEditor.commit();
}

public int[] getPrefIntArray(String tag, int[] defaultValue)
{
    SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);

    String s = pref.getString(tag, "");

    try
    {
        JSONObject json = new JSONObject(new JSONTokener(s));
        JSONArray jsonArr = json.getJSONArray(tag);

        int[] result = new int[jsonArr.length()];

        for (int i = 0; i < jsonArr.length(); i++)
            result[i] = jsonArr.getInt(i);

        return result;
    }
    catch(JSONException excp)
    {
        return defaultValue;
    }
}

It gives the following errror:

ValueError: Wrong number of items passed 259, placement implies 1

1 个答案:

答案 0 :(得分:0)

尝试:

new_pop = pop.values*math.e**(35*(prec.values/100))