FAQ Database Discussion Community


filling numpy array with mean values form data

numpy,fill
Why does this produce an array of zeros for q, instead of the actualy value or err which is 0.0159? errors=np.loadtxt('data').T[2] err=np.mean(errors) q=np.empty(99) q.fill(err) ...

Fill empty space

html,css,css-float,fill,autofill
Hi guys this is my problem (please visit the image link): http://dominioestudio.com/example.png Im making a website and i cant figure it out how to fill the red space with the element below (the one into the cian rectangle). This is the code from those elements (the gray contents) .post {...

unity3d - Change Image.fillAmount

image,unity3d,fill
I have an image acting as a health bar, and i want to give it a cistume value more than 1: public Image healthBar; // Use this for initialization void Start () { float health = 4; healthBar.fillAmount = health; Debug.Log (gameObject + ""+ healthBar.fillAmount); } Problem is no matter...

fill list box with each day from date to date vb.net

vb.net,date,listbox,fill
I want to add dates for everyday in list box since 1/1/2014 until the day when someone load my form,as the following: 1/Jan/2014 2/Jan/2014 3/Jan/2014 .. .. .. today's date thanks...

Java lottery fill array

java,arrays,fill
Here's the code: public void playMany() { for (int i = 0; i < lotteryNumbers.length; i++) { lotteryNumbers[i] = 0 + r.nextInt(9); } for (int i = 0; i < playersNumbers.length; i++) { playersNumbers[i] = 0 + r.nextInt(9); } for (int i = 0; i < lotteryNumbers.length; i++) { if...

Fill color under a line graph in D3

csv,d3.js,fill,linechart
I'm attempting to make a gradient chart with the fill color under the line graph based on the gradient calculated by the average of every 100m for a 1500m course. Here's what I'm starting with, but I'm pretty lost as to where to go from here. I've done a bit...

Fill Javascript object with fixed length multidimensional array

javascript,arrays,object,multidimensional-array,fill
I am trying to wrap my head around javascript objects and arrays. I attempted to fill and access an object as following: obj_keys = [1,2,3,4,5,6,7]; o = {}; $.each(obj_keys, function(k, v){ o[v] = []; for(var c; c < 10; c++){ o[v][c] = []; o[v][c].push([11,12,13,14]); } }); console.log(o); Object { 1:...

wxPerl: add component which resizes automatically when parent frame gets resized

perl,fill,expand,wxperl
I am relatively new to Perl and I am using wxPerl to create a GUI application. Now, I want to add a Panel into a Frame, possibly using a sizer so that the panel resizes automatically as the frame gets resized. So here's what I got: (1) I have to...

How to change color palette of mosaic plot

r,plot,colors,fill
I have following data and code: > mat <- matrix(c(120,230,84,70,130,83,13,26,18),3) > dimnames(mat) <- list(c("good","fair","poor"),c("a","b","c")) > mat > mat a b c good 120 70 13 fair 230 130 26 poor 84 83 18 > > chisq.test(mat) Pearson's Chi-squared test data: mat X-squared = 11.411, df = 4, p-value = 0.02231...

How I can fix this array

c,arrays,sorting,vector,fill
Good morning, I was trying to fill a dynamic vector but when I print the input data i get something like this: input: 1,5,3,4,2 output: 0,1,5,3,4 Could somebody help me? I can't fix it. I've been trying a lot and can't get it. I'll apreciatte so much (sorry for the...

Python: Insert two sets of chars into a matrix

python,matrix,fill,chars
Working with the Playfair cipher. I have two sets of chars: a keyword and the rest of the alphabet without the characters within the keyword. Example (Due to the nature of the Playfair cipher, 'i' is not taken into account to work with 25 characters, good fit for a 5x5...

How to fill entire calendar header from border to border?

html,css,background,header,fill
I can't fill all header, for example, with red color, because it's filling only in the area of text and I need to be filled from top left corner grey area to where days are starting. Here is html: <div id="calendar-container"> <div id="calendar-header"> <span id="calendar-month-year"></span> <div id="calendar-dates"></div> </div> </div> and...

Java how to fill array

java,arrays,floating-point,numbers,fill
public static void main(String[] args) { float numberF[]=new float[7]; displayF(numberF); } public static void displayF(float x[]) { int one = 1; double sum = 0; for (int row = 0; row < x.length; row++) { sum = Math.pow(one, 2); x[row] = (int) sum; System.out.printf("%.0f.%.0f ",x[row], x[row] ); one++; } }...

Object-oriented access to fill_between shaded region in matplotlib

python,matplotlib,plot,fill
I'm trying to get access to the shaded region of a matplotlib plot, so that I can remove it without doing plt.cla() [since cla() clears the whole axis including axis label too] If I were plotting I line, I could do: import matplotlib.pyplot as plt ax = plt.gca() ax.plot(x,y) ax.set_xlabel('My...

matlab fill plotting, strange properties

matlab,plot,fill
Update: i have replicated the issue in 2014a on a windows 8 machine. I am attempting to generate a large number of images of squares at varying fill colors using MATLAB (2014a, OSX Yosemite). I find that the fill command is the easiest way to accomplish this -- i simply...

how to color a heart-shaped form I drew on Qt creator using c++

forms,qt,fill,qpainter
I have a little problem. I'm doing a video game in c++ using qt creator, and I would like to fill a form I drew in red. I colored the line but I can't find how to fill all the form. On the qt's doc, it explains how to fill...

Filling density plot with colours

r,ggplot2,fill
I have this ggplot2 script: require(reshape2) library(ggplot2) library(RColorBrewer) library(extrafont) font_import(pattern = 'Arch') font_import(pattern = 'Akk') fileName = paste("/ex_spectra.csv", sep = "") # data: https://www.dropbox.com/s/gs1hwv3xjnlhb7z/ex_spectra.csv?dl=0 mydata = read.csv(fileName,sep=",", header=TRUE, check.names=FALSE) dataM = melt(mydata,c("x")) my_palette = c(brewer.pal(5, "Set1")[c(1,2,3,4,5)]) ggplot(data=dataM, aes(x= x, y=value, colour=variable, fill = variable, size = variable)) + geom_line(alpha =...

fill command cannot be used

c#,dataset,oledb,fill
This Is my code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.SessionState; //db con using System.Data; using System.Data.OleDb; using System.Data.SqlClient; using System.Configuration; namespace SOMaintenance.App_Code { public class readdata { string sConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; public void selectdata(DataSet dataset1, string sqlcommand) { string strConString =...

How to set fill alpha in PDF

pdf,alpha,fill
This is a red box: 162 86 m 162 286 l 362 286 l 362 86 l h 1 0 0 rg f How can I add partial transparency to it? I've read the transparency section of the PDF spec, but I can only seem to find models and formulas,...

With ggplot2, what code creates bars made of individual words and their count?

r,ggplot2,fill,geom-bar
To convey the relative frequencies of key words, I would like each "bar" in a plot to consist of one of the words repeated vertically by its frequency. The ggplot code below removes the outline of the bar and the fill, but how can I create a "stack" of words...

VSTO - How to make Ribbon buttons to fill vertically the blank space

excel,button,vsto,ribbon,fill
I'm building a VSTO excel application, using Visual Studio 2013. I have one Large sized Ribbon button in one column, next to two Regular sized in another column. What I want is to fill the vertical space in the regular buttons column equally. To see an example of what I...

groupby on sparse matrix in pandas: filling them first

pandas,fill,sparse
I have a pandas DataFrame df with shape (1000000,3) as follows: id cat team 1 'cat1' A 1 'cat2' A 2 'cat3' B 3 'cat1' A 4 'cat3' B 4 'cat1' B Then I dummify with respect to the cat column in order to get ready for a machine learning...

Filling in polygon with my polygon fill algorithm give an out of bounds error

java,polygon,indexoutofboundsexception,fill
I am creating a program that takes draws a polygon and then fills the polygon with green. I am currently having an issue with the algorithm I have written as it only fills the top half of the polygon and then I get an IndexOutOfBounds error. Here is the code...

conditional replace based off prior value in same column of pandas dataframe python

python,pandas,replace,fill,calculated-columns
Feel like I've looked just about everywhere and I know its probably something very simple. I'm working with a pandas dataframe and looking to fill/replace data in one of the columns based on data from that SAME column. I'm typically more of an excel guy and it is sooo simple...