multiple-columns

How to Customize Bootstrap Column Widths?

微笑、不失礼 提交于 2019-11-28 06:20:34
I have this, but I feel 4 is too big for my sidebar width and 3 is too small (it has to add up to 12). <div class="col-md-8"> <div class="col-md-4"> I tried this but it doesn't work: <div class="col-md-8.5"> <div class="col-md-3.5"> Is there another way to get a similar outcome? Thanks for your help! To expand on @isherwood's answer, here is the complete code for creating custom -sm- widths in Bootstrap 3.3 In general you want to search for an existing column width (say col-sm-3 ) and copy over all the styles that apply to it, including generic ones, over to your custom stylesheet where you

ddply + summarize for repeating same statistical function across large number of columns

北城以北 提交于 2019-11-28 03:07:04
Ok, second R question in quick succession. My data: Timestamp St_01 St_02 ... 1 2008-02-08 00:00:00 26.020 25.840 ... 2 2008-02-08 00:10:00 25.985 25.790 ... 3 2008-02-08 00:20:00 25.930 25.765 ... 4 2008-02-08 00:30:00 25.925 25.730 ... 5 2008-02-08 00:40:00 25.975 25.695 ... ... Basically normally I would use a combination of ddply and summarize to calculate ensembles (e.g. mean for every hour across the whole year). In the case above, I would create a category, e.g. hour (e.g. strptime(data$Timestamp,"%H") -> data$hour and then use that category in ddply , like ddply(data,"hour", summarize,

Change all columns from factor to numeric in R

那年仲夏 提交于 2019-11-28 02:03:59
问题 I am working with a big dataset that is causing some trouble because some of the columns I the dataset are being treated as factors. How can I convert all of the columns from factor to numeric, without having to do that column by column?? I have tried to apply a small loop, but it returns NA values. Here's a sample data that applies to the case: data <- structure(list(v1 = c(22.394, 43.72, 58.544, 56.877, 1.659, 29.142, 67.836, 68.851), v2 = c(144.373, 72.3, 119.418, 112.429, 35.779, 41.661,

Python - Calculate average for every column in a csv file

烂漫一生 提交于 2019-11-28 01:49:30
问题 I'm new in Python and I'm trying to get the average of every (column or row) of a csv file for then select the values that are higher than the double of the average of its column (o row). My file have hundreds of columns, and have float values like these: 845.123,452.234,653.23,... 432.123,213.452.421.532,... 743.234,532,432.423,... I've tried several changes to my code to get the average for every column (separately), but at the moment my code is like this one: def AverageColumn (c): f=open

Splitting text column into ragged multiple new columns in a data table in R

末鹿安然 提交于 2019-11-27 23:15:19
I have a data table containing 20000+ rows and one column. The string in each column has different number of words. I want to split the words and put each of them in a new column. I know how I can do it word by word: Data [ , Word1 := as.character(lapply(strsplit(as.character(Data$complaint), split=" "), "[", 1))] ( Data is my data table and complaint is the name of the column) Obviously, this is not efficient because each cell in each row has different number of words. Could you please tell me about a more efficient way to do this? Check out cSplit from my "splitstackshape" package. It works

Set the variable result, from query

邮差的信 提交于 2019-11-27 20:32:11
When I create the saved procedure, i can create some variable yes? for example: CREATE PROCEDURE `some_proc` () BEGIN DECLARE some_var INT; SET some_var = 3; .... QUESTION: but how to set variable result from the query, that is how to make some like this: DECLARE some_var INT; SET some_var = SELECT COUNT(*) FROM mytable ; ? Roland Bouman There are multiple ways to do this. You can use a subquery: SET some_var = (SELECT COUNT(*) FROM mytable); (like your original, just add parenthesis around the query) or use the SELECT INTO syntax to assign multiple values: SELECT COUNT(*), MAX(col) INTO some

How to merge/combine columns in pandas?

假如想象 提交于 2019-11-27 18:54:05
问题 I have a (example-) dataframe with 4 columns: data = {'A': ['a', 'b', 'c', 'd', 'e', 'f'], 'B': [42, 52, np.nan, np.nan, np.nan, np.nan], 'C': [np.nan, np.nan, 31, 2, np.nan, np.nan], 'D': [np.nan, np.nan, np.nan, np.nan, 62, 70]} df = pd.DataFrame(data, columns = ['A', 'B', 'C', 'D']) A B C D 0 a 42.0 NaN NaN 1 b 52.0 NaN NaN 2 c NaN 31.0 NaN 3 d NaN 2.0 NaN 4 e NaN NaN 62.0 5 f NaN NaN 70.0 I would now like to merge/combine columns B, C, and D to a new column E like in this example: data2 =

Assign unique ID based on two columns [duplicate]

社会主义新天地 提交于 2019-11-27 14:49:02
This question already has an answer here: Add ID column by group [duplicate] 4 answers How to create a consecutive index based on a grouping variable in a dataframe 6 answers I have a dataframe (df) that looks like this: School Student Year A 10 1999 A 10 2000 A 20 1999 A 20 2000 A 20 2001 B 10 1999 B 10 2000 And I would like to create a person ID column so that df looks like this: ID School Student Year 1 A 10 1999 1 A 10 2000 2 A 20 1999 2 A 20 2000 2 A 20 2001 3 B 10 1999 3 B 10 2000 In other words, the ID variable indicates which person it is in the dataset, accounting for both Student

Multicolumn ListBox in WPF

你说的曾经没有我的故事 提交于 2019-11-27 14:46:11
问题 I have 3 TextBoxes and 1 Button and want to enter each of the the TextBoxes data into a ListBox in separate columns. I know how to enter data into one column: listbox1.Items.Add(TextBox1.text); but how can I enter the data into multiple columns? I am using .NET WPF. I want to use a ListBox or a ListView . my window 回答1: You want a ListView instead: Something like this: <ListView ItemsSource="{Binding SourceCollection}"> <ListView.View> <GridView> <GridViewColumn Header="Test1"

LINQ to Entities - where..in clause with multiple columns

浪尽此生 提交于 2019-11-27 14:45:29
问题 I'm trying to query data of the form with LINQ-to-EF: class Location { string Country; string City; string Address; … } by looking up a location by the tuple (Country, City, Address). I tried var keys = new[] { new {Country=…, City=…, Address=…}, … } var result = from loc in Location where keys.Contains(new { Country=loc.Country, City=loc.City, Address=loc.Address } but LINQ doesn't want to accept an anonymous type (which I understand is the way to express tuples in LINQ) as the parameter to