Python Forum
How to concatenate elements of different type in a table cell?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to concatenate elements of different type in a table cell?
#4
I'm still not sure what you're trying to do, but to use a 'list' in python
(which is an array), and split off the mantissa and exponent of a float,
you can use something like:
p = [2.07155254, -20.60156854, 19.5483871, 4.19432936]
# Split mantissa and exponent
for n, value in enumerate(p):
   parts = str(value).split('.')
   print('Value: {}, mantissa: {}, exponent: {}'.format(n, parts[0], parts[1]))
which will produce:
Output:
Value: 0, mantissa: 2, exponent: 07155254 Value: 1, mantissa: -20, exponent: 60156854 Value: 2, mantissa: 19, exponent: 5483871 Value: 3, mantissa: 4, exponent: 19432936
Reply


Messages In This Thread
RE: How to concatenate elements of different type in a table cell? - by Larz60+ - Jul-07-2017, 12:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Concatenate 3D arrays paul18fr 1 2,729 Apr-09-2021, 02:49 PM
Last Post: paul18fr
  Formula with elements of list - If-condition regarding the lists elements lewielewis 2 2,793 May-08-2020, 01:41 PM
Last Post: nnk
  How to prepare a NumPy array which include float type array elements subhash 0 1,946 Mar-02-2020, 06:46 AM
Last Post: subhash
  concatenate mcgrim 1 2,278 Mar-22-2019, 01:31 PM
Last Post: buran
  Checking the elements of a matrix with an elements of a list juniorcoder 11 5,972 Sep-17-2018, 03:02 PM
Last Post: gruntfutuk
  Slicing String cell by cell Vigneshkumarsakthivel 0 2,429 Sep-02-2018, 05:59 PM
Last Post: Vigneshkumarsakthivel
  Concatenate Specific Cell Interval With Pandas vidividi12 0 2,869 Oct-01-2017, 02:16 PM
Last Post: vidividi12
  How can i convert a string to an array with elements type float 64 zoya2385 3 6,193 May-11-2017, 03:57 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020