How to maintain the format of text while sharing as email using power automate - power-automate

I have created a flow, which extracts a .txt file from SharePoint and sends them in body of email using power automate. The flow is successful but the format part like, bold, space, paragraph etc; is not present. It just looks like continuous chunk of words. How to convert them back to proper format.
Edited!!
*Sample Input Text format and Expected output
Q: What is global warming?
A: Since the Industrial Revolution, the global annual temperature has increased in total by a little more than 1 degree Celsius, or about 2 degrees Fahrenheit.
- Between 1880—the year that accurate recordkeeping began—and 1980, it rose on average by 0.07 degrees Celsius (0.13 degrees Fahrenheit) every 10 years.
- The result? A planet that has never been hotter.
- Nine of the 10 warmest years since 1880 have occurred since 2005—and the 5 warmest years on record have all occurred since 2015.
**Received Output **
Q: What is global warming? A: Since the Industrial Revolution, the global annual temperature has increased in total by a little more than 1 degree Celsius, or about 2 degrees Fahrenheit. Between 1880—the year that accurate recordkeeping began—and 1980, it rose on average by 0.07 degrees Celsius (0.13 degrees Fahrenheit) every 10 years. The result? A planet that has never been hotter. Nine of the 10 warmest years since 1880 have occurred since 2005—and the 5 warmest years on record have all occurred since 2015.
FLOW

Related

How to estimate customer lifetime value in daily increments using BG/Gamma Gamma Models (spend model) in Python?

I am calculating customer lifetime value and this estimation is performed in monthly increments. I would like to calculate CLV in increments of 7 days, 14 days etc.. using the model parameters (see below), do i convert days into month, for i.e., 7 days = 0.23 months ...
print(ggf.customer_lifetime_value(
bgf, #the model to use to predict the number of future transactions
summary_with_money_value['frequency'],
summary_with_money_value['recency'],
summary_with_money_value['T'],
summary_with_money_value['monetary_value'],
time=12, # months
discount_rate=0.01 # monthly discount rate ~ 12.7% annually
).head(10))
I tried to convert days into months for 7 days, 14 days but I would like confirmation (peer) / fellow Data Scientists, ML experts to confirm/ not confirm.

Irregular intervals - where to draw a line?

I have a line chart ( x represents date, y represents amount of car rentals on that date) that needs to be connected at all times, since the values are all valid - there is always at least one car rental per that date. The only time that the line shouldn't be connected, but should make a gap between two valid values/points is when the two successive dates are too wide apart. I have to figure out the best alghorithm for what this 'two wide apart' means and, based on these dates (or something), set a parameter.I don't know all the possible combinations of dates, but I think they can be anything:
2010 2011 2013 2018 2019
or
1990 2001 2002 2012 2015
or
possibly anything else
Is there any standard way to deal with this kind of problem?
The problem is to characterize what it means to be too wide apart. One solution is to build a histogram (i.e. a probability density function) of the date differences of the x coordinates of the data points, and then to consider as too wide, those differences that are in, say the top 33% (or whatever other proportion you wish).
For example, suppose the x coordinates are the years:
1990 1995 2001 2002 2003 2010 2011 2012 2013 2017 2019
Let say we calculate date differences in years (we could choose any other duration unit). We calculate the differences between the values above and build the histogram below.
Counts: 5 1 0 1 1 1 1
Diff.: 1 2 3 4 5 6 7
Now, if we choose to keep disconnected differences in the top 33%, from the histogram, this means that differences greater than or equal to 5 years would be disconnected.

How to calculate average time zones for a group of users?

Alice lives in Russia(GMT+7). Bob lives in Alaska(GMT-8). They are relatively close, and less than 200 miles apart. https://www.google.com/maps/#55.5067319,-173.8489655,3z
Alice and Bob should meet at noon based on an average of their Time Zones so both people are inconvenienced as little as possible. If we average GMT+7 with GMT-8, we come up with GMT-0.5.
This does not work because calculating noon based on GMT-0.5 would be closer to midnight for both, rather than noon because the time zones are calculated linearly instead of circularly.
Does anyone know of a library which can solve Alice, Bob's problem, and also allow Charlie and Dave to join the meeting?
Your GMT-0.5 average is wrong, because to get the time difference we have to take into account the 24 hour cycle and the fact that GMT is half way between both ends of the range.
GMT+0700 is 15 hours ahead of GMT-0800, but as 15 is greater than 12 (more than half way round the Earth) the shortest time difference is actually 9 hours, but on different days.
That maths is pretty easy. In pseudo code:
offset = abs( 7 - -8 )
if offset > 12 then offset = 24 - offset
Gives offset == 9.
So the closest times to local noon for both parties would be 4.5 hours before noon for Alice in Russia (07:30am) and 4.5 hours after noon for Bob in Alaska (16:30pm) but on the previous day because Russia is in the future!
This half way point would be an imaginary time offset we can call GMT+1130, so Bob and Alice would arrange to meet at 00:30 GMT.
For comparison: timeanddate.com has a meeting planner. It rounds to the hour and gives the best overlaps for Krasnoyarsk and Anchorage as 8am/5pm.
See https://www.timeanddate.com/worldclock/meetingtime.html?iso=20180724&p1=372&p2=18
Academic side point: these two timezones are not a mere 200 miles from each other. They are thousands of miles apart. The eastern point of Russia is actually 12 hours ahead of GMT.

suitable formula/algorithm for detecting temperature fluctuations

I'm creating an app to monitor water quality. The temperature data is updated every 2 min to firebase real-time database. App has two requirements
1) It should alert the user when temperature exceed 33 degree or drop below 23 degree - This part is done
2) It should alert user when it has big temperature fluctuation after analysing data every 30min - This part i'm confused.
I don't know what algorithm to use to detect big temperature fluctuation over a period of time and alert the user. Can someone help me on this?
For a period of 30 minutes, your app would give you 15 values.
If you want to figure out a big change in this data, then there is one way to do so.
You can use implement the following method:
Calculate the mean and the standard deviation of the values.
Subtract the data you have from the mean and then take the absolute value of the result.
Compare if the absolute value is greater than one standard deviation, if it is greater then you have a big data.
See this example for better understanding:
Lets suppose you have these values for 10 minutes:
25,27,24,35,28
First Step:
Mean = 27 (apprx)
One standard deviation = 3.8
Second Step: Absolute(Data - Mean)
abs(25-27) = 2
abs(27-27) = 0
abs(24-27) = 3
abs(35-27) = 8
abs(28-27) = 1
Third Step
Check if any of the subtraction is greater than standard deviation
abs(35-27) gives 8 which is greater than 3.8
So, there is a big fluctuation. If all the subtracted results are less than standard deviation, then there is no fluctuation.
You can still improvise the result by selecting two or three standard deviation instead of one standard deviation.
Start by defining what you mean by fluctuation.
You don't say what temperature scale you're using. Fahrenheit, Celsius, Rankine, or Kelvin?
Your sampling rate is a new data value every two minutes. Do you define fluctuation as the absolute value of the difference between the last point and current value? That's defensible.
If the max allowable absolute value is some multiple of your 33-23 = 10 degrees you're in business.

D3 Getting Y value of a trend line for current X

I'm drawing a line chart from database values of the current day, I'm also drawing a second "trend line" after some calculations to well... know how they day is going, this trend line has only 4 points for 6 a.m., 8 a.m., 12m. and 6 p.m. For example:
[Data]
06:00:00, 10
08:00:00, 30
12:00:00, 110
06:00:00, 320
I would like to check if my current value is below or above my trend line to display warnings or maybe send notifications (at any given time during the day, preferably the latest time read). I've tried several things but all I can get are the known 4 values(for those hours) of my trend line, nothing in between.

Resources