Questions tagged [divide]

Separate or be separated into parts

Separate or be separated into parts

688 questions
7
votes
4 answers

Divide in SQL Server

In SQL Server 2005 Express, the result is below SELECT 100 / 15 --Result 6 But I wanna get approximate value 7 (like using calculator) 100 / 15 = 6.6666.. How to make it in SQL Server?
soclose
  • 2,773
  • 12
  • 51
  • 60
7
votes
3 answers

Divide One Pandas Dataframe by Another - Ignore index but respect columns

I have 2 dataframes. I would like to broadcast a divide operation df1= pd.DataFrame([[1.,2.,3.,4.], [5.,6.,7.,8.], [9.,10.,11.,12.]], columns=['A','B','C','D'], index=['x','y','z']) df2= pd.DataFrame([[0.,1.,2.,3.]],…
Dickster
  • 2,969
  • 3
  • 23
  • 29
7
votes
1 answer

BigDecimal 1.0E+8 / 100000000 with ROUND_HALF_UP is 0

Can some one explain why I get 0 as result for the first line? System.out.println((new BigDecimal("1.0E+8")).divide(new BigDecimal(100000000), BigDecimal.ROUND_HALF_UP)); System.out.println((new…
halber
  • 197
  • 2
  • 11
7
votes
5 answers

Is that possible to divide all elements in C# double list to that double list elements sum (which makes total = 1)

Imagine a doube list like the follow List lstDouble=new List{4,6,2,7,1,1}; So what i want is dividing all elements in this list to sum of the elements(21). So the list becomes after dividing : lstDouble =…
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342
6
votes
2 answers

Grafana dividing 2 series

I'm trying to divide 2 series to get their ratio. For example I'm got sites (a.com, b.com, c.com) as * (All sites) Each of them has total sections count and errors occurred stats. I'm wanna to show as bars errors/sections where section > errors for…
Denis Kovalenko
  • 61
  • 1
  • 1
  • 3
6
votes
1 answer

divide pandas dataframe elements by its line max

I wonder how to divide the elements in DataFrame by its line max. See following code: index = pd.date_range('1/1/2000', periods=8) df = DataFrame(np.random.randn(8, 3), index=index, columns=['A', 'B', 'C']) dfMax = df.max(axis=1) and then, the…
perigee
  • 9,438
  • 11
  • 31
  • 35
5
votes
1 answer

How to divide a large Django project into sub projects for scaling?

Django project(e-commerce website) that we need to divide into sub-projects as a Buyer, Seller, and Admin and will create three databases accordingly. So how can we manage the same Models(Schema) in 3 projects if it is updated in one project?.
Afsal KK
  • 603
  • 1
  • 11
  • 15
5
votes
5 answers

sum divided values problem (dealing with rounding error)

I've a product that costs 4€ and i need to divide this money for 3 departments. On the second column, i need to get the number of rows for this product and divide for the number of departments. My query: select department, totalvalue, …
Fernando
  • 53
  • 1
  • 4
5
votes
2 answers

Is it possible to divide one dataframe from another dataframe?

Here is the head of my first dataframe, A1: K37L K37M K37N K37P K37Q K37R K37S K37T K37U K37V ... \ 1997-01-01 79.8 80.4 72.8 36.7 0.0 90.0 96.9 92.2 79.8 93.7 ... 1997-02-01 79.1 81.7 73.6 36.7 0.0 …
DanONS
  • 195
  • 1
  • 2
  • 7
5
votes
4 answers

How to group element in ArrayList and divide into three List

I have an entity class class Entity { private String customer; private String product; private String productDetail; } I have an ArrayList including many records, for example record in my list: customer …
Dragon
  • 95
  • 2
  • 9
5
votes
7 answers

Is there any way to divide rgb color palette?

I'm trying to generate a color palette which has 16 colors. i will display this palette in 4x4 grid. so i have to find a way to rgb color palette which has 255*255*255 colors divided to 16 colors equally and logically. i think it's gonna be a…
Mehmet Fatih Yıldız
  • 1,763
  • 18
  • 25
5
votes
1 answer

Significant Inversions in an array

I'm working on a homework problem to find the number of significant inversions in an array of integers. "Significant inversion" is defined as follows: A significant inversion in a permutation [a0, a1, a2, ..., an] is one in which ai > 2 aj for some…
piranha
  • 141
  • 1
  • 2
  • 9
5
votes
2 answers

Seeking extended Divide operator explanation

I am reading about Codd’s Eight Original Operators in Inside Microsoft SQL Server 2008: T-SQL Querying by Itzik Ben-Gan, Lubor Kollar, Dejan Sarka, and Steve Kass and do not understand the Divide operator. Quotes defining the Divide operator: “A…
Jesslyn
  • 696
  • 10
  • 25
5
votes
1 answer

How to divide polygon in R?

I have a shapefile of Amazonas state (Brazil) and other with the six biggest rivers in this state (Negro, Solimões, Amazonas, Madeira, Purus and Juruá). I want to divide the state using the rivers, to get the interfluvial areas (Madeira-Purus,…
Rodrigo
  • 4,706
  • 6
  • 51
  • 94
5
votes
4 answers

python list group by first character

list1=['hello','hope','hate','hack','bit','basket','code','come','chess'] What I need is: list2=[['hello','hope','hate','hack'],['bit','basket'],['code','come','chess']] If the first character is the same and is the same group, then sublist…
Lee_Prison
  • 239
  • 1
  • 3
  • 7
1 2
3
45 46