My List that comes from my MAP function I need to get to 4 decimal places - '''
-
a = [5,4,6,8,9,12]
-
b = [3,5,3,7,4,10]
-
c = [4,7,7,4,10,14]
-
-
-
#Gets S List
-
hlist = map(add,a,b)
-
h2list = map(add,hlist,c)
-
twolist = [2,2,2,2,2,2]
-
s = map(truediv,h2list,twolist)
-
-
-
sqrtlist = [0.5,0.5,0.5,0.5,0.5,0.5]
-
sa = map(sub,s,a) # (s-a)
-
sb = map(sub,s,b) # (s-b)
-
sc = map(sub,s,c) # (s-c)
-
sasb = map(mul,sa,sb) # (s-a)*(s-b)
-
sall = map(mul,sasb,sc) # (s-a)*(s-b)*(s-c)
-
x = map(mul,s,sall) # Multiplies inside by s
-
-
def square(x):
-
return x**0.5
-
-
A = map(square,x)
-
-
-
AA = map(lambda x: x**0.5,x)
-
'''
-
"""
-
#OUTPUT
-
AA list
-
[6.0, 9.797958971132712, 8.94427190999916, 13.997767679169419, 17.984368212422698, 58.787753826796276]
-
-
[6.0, 8.0, 8.0, 9.5, 11.5, 18.0]
-
"""
-
Thats my current code, minus some things. The numbers are correct I just need to to be rounded
0 1094 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Brent Bortnick |
last post by:
Does anyone know how to find out the number of decimal
places a number has. I need this info so that i can round
to 3 decimal places if the number has 3 decimal places or
to 2 decimal places if...
|
by: John Bentley |
last post by:
John Bentley writes at this level:
If we think about our savings accounts then division never comes in (as far as
I can see). We deposit and withdraw exact amounts most of the time. Occasionaly...
|
by: Hank |
last post by:
Hello,
I am displaying numerical (single) values from a table into a
list box using Access 2000. Although the format in the table is for
three decimal places, the list box rounds all the columns...
|
by: GaryB |
last post by:
I have a database field that is the product of a multiply in a sql statement
and it sometimes has 5 or more decimal places. I want to truncate beyond
the 2nd decimal place(###.##). I figured a...
|
by: Hank |
last post by:
Hello,
I'm running Access 2000. I would like to know if its
possible to use VBA code to determine how many decimal places are
specified for each table field.
Currently I loop throught the...
|
by: VK |
last post by:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/
b495b4898808fde0>
is more than one month old - this may pose problem for posting over
some news servers. This is why I'm...
|
by: mattlightbourn |
last post by:
Hi,
I hope you're all well.
I need to right justify some figures in a list box and the only way I seem to be able to do it is by using the number as text and doing something like this in a...
|
by: =?Utf-8?B?S3VuYWwgUGF0ZWw=?= |
last post by:
I have a DataTable with Column DataType as Double I just want to show data in
C# datagrid with two decimal places
which property do I set for DataColum of DataTable and How?
Thanks
|
by: =?Utf-8?B?THVpZ2k=?= |
last post by:
Hi all,
I have a collection (an array for example) of decimal values.
I need to round them and take care of the roundings.
For example, if I have
decimal a = 10.50m
should became 10
and if
|
by: VivDenham |
last post by:
Hi there
I have a table - Projects - with 2 fields: Project ID (autonumber) and Project Name.
I then have a 2nd table - Decorations Used - which contains 3 fields - Decorations Used Id; Project...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |