In python, write the contents of the x and y lists to a file called xy2.dat with one value from x and y on each line, separated by a comma.
x = [-1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4,
-0.30000000000000004, -0.19999999999999996,
-0.09999999999999998,
0.0, 0.10000000000000009, 0.19999999999999996,
0.30000000000000004,
0.3999999999999999, 0.5, 0.6000000000000001, 0.7, 0.8,
0.8999999999999999, 1.0]
y = [1.0, 0.78, 0.67, 0.51, 0.27, 0.0, 0.14, 0.19, -0.14,
0.03,
0.03, -0.09, -0.03, -0.12, 0.14, 0.36, 0.57, 0.63, 0.61, 0.59,
1.01]
#solution for the above problem
Code:
#opening or creating file named xy2.dat if file does not exits it create
a=open("xy2.dat",mode="w")
#intial data of x and y
x = [-1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4,
-0.30000000000000004, -0.19999999999999996,
-0.09999999999999998,
0.0, 0.10000000000000009, 0.19999999999999996,
0.30000000000000004,
0.3999999999999999, 0.5, 0.6000000000000001, 0.7, 0.8,
0.8999999999999999, 1.0]
y = [1.0, 0.78, 0.67, 0.51, 0.27, 0.0, 0.14, 0.19,
-0.14, 0.03,
0.03, -0.09, -0.03, -0.12, 0.14, 0.36, 0.57, 0.63, 0.61, 0.59,
1.01]
#iterating the data to write to the file
for i in range(len(x)):
#writing the value of x
a.write(str(x[i]))
#with seperated by comma
a.write(',')
#wiritng the value of y
a.write(str(y[i]))
#entering into the newline
a.write('\n')
#closing the file
a.close()
#reopen the file to show output
b=open("xy2.dat",mode="r")
#finally written information in the file named xy2
print(b.read())
#Screenshots


#output
In python, write the contents of the x and y lists to a file called xy2.dat...
2. (25 P) A random number generator was used to generate a 100 numbers listed below. Perform x2 goodness of fit test to check whether the data distributed uniformly in the interval [0, 1] (a= 0.05, state the hypothesis first). 0.01 0.01 0.02 0.03 0.03 0.05 0.05 0.06 0.06 0.06 0.07 0.08 0.08 0.09 0.12 0.13 0.15 0.16 0.18 0.19 0.21 0.24 0.24 0.25 0.25 0.26 0.27 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.3 0.31 0.32 0.32 0.33 0.33...
0.00 0.20 0.60 0.43 0.75 0.27 1.45 0.19 0.26 0.04 0.61 0.26 0.80 0.36 0.26 1.30 0.01 0.10 0.06 0.19 0.51 1.74 0.01 0.19 0.06 0.19 0.17 0.25 0.24 0.36 0.15 0.36 0.07 1.18 0.83 0.23 0.06 0.01 0.05 0.78 1.14 0.41 0.38 0.40 1.46 0.07 0.63 0.91 0.21 0.75 0.19 0.59 0.12 1.12 0.97 0.02 0.04 0.38 0.56 0.33 0.16 0.16 0.29 0.24 0.02 0.98 0.44 0.19 0.63 0.59 0.50 0.40 1.56 0.12 3.17 0.13 0.41 0.11 0.05 0.59...
Please calculate the chemical shift for Ha using the "Aromatic Proton Shift Calculation" Table. Ha H3C02C CN MezN Hb Hc Answer: Fr Jump to... CHEM 308 Class 15.04.2024 CHEM 308 AROMATIC PROTONS CHEMICAL SHIFT CALCULATION SHEET H Zomo DAH = 7.36 + Zorme + Zmeta + Zpara Z mets Zpara Zi for R (ppm) Substituent R Zortho Zmeta Zpara Zmet Zpara H CH, 0.0 -0.18 0.02 0.02 -0.07 C(CH3) CHCI CH,OH 0.0 -0.11 -0.08 -0.01 -0.07 Zi for R (ppm)...
Questions 1. Given the H NMR spectrum and molec- ular formula for each of the following compounds, deduce the structure of the compound, estimate the chemical shifts of all its protons using the parameters in Tables 22.3–22.5, and assign the NMR sig- nals to their respective protons. (a) C.H,,Cl; 1H NMR (CDC12): 8 3.33 (2H, s); 1.10 (9H, s) (b) C-H,,0,; 1H NMR (CDC12): 8 3.88 (1H, s); 2.25 (3H, s); 1.40 (6H, s) (C) CH,,0,; 1H NMR (CDC1,): 8...
Use Table 8.1, a computer, or a calculator to answer the following. Suppose a candidate for public office is favored by only 47% of the voters. If a sample survey randomly selects 2,500 voters, the percentage in the sample who favor the candidate can be thought of as a measurement from a normal curve with a mean of 47% and a standard deviation of 1%. Based on this information, how often (as a %) would such a survey show that...
Answer question 4-5. Thanks
The Global Land and Ocean Temperature Anomalies (the difference between the actual temperature and the mean (normal) temperature were calculated every November from 1880-2015, and they are presented below in Table 2 . Create a graphical representation of the data with the Tomperatan Amaier on the y-axis and Yar on the 2. Find the average, standard deviation, and range of the temperature anomalies. Interpret the results. 3. Find the average temperature anomalies and standard deviations for...
Answer each question please
The Global Land and Ocean Temperature Anomalies (the difference between the actual temperature and the mean (normal) temperature were calculated every November from 1880-2015, and they are presented below in Table 2 . Create a graphical representation of the data with the Tomperatan Amaier on the y-axis and Yar on the 2. Find the average, standard deviation, and range of the temperature anomalies. Interpret the results. 3. Find the average temperature anomalies and standard deviations for...
GIFT WRAPPING ALGORITHM OF JARVIS MARCH In mathematics, the convex hull of a set of points is the smallest convex set that contains these points. The convex hull may be visualized as the shape enclosed by a rubber band stretched around these points (see the figure below). In your first homework, you are going to compute the convex hull of a set of given points in a separate file (input.txt). For the given set of 14 points below, you can...
The following results were obtained from an undrained shear box test carried out on a set of undisturbed soil samples. 0.2 0.8 Normal Load (N) Strain (%) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 0 21 46 70 89 107 121 131 136 138 138 137 136 0.4 Shearing force (N) 0 33 72 110 139 164 180 192 201 210 217 224 230 234 237 236 0 45...
The following results were obtained from an undrained shear box test carried out on a set of undisturbed soil samples. 0.2 0.8 Normal Load (N) Strain (%) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 0 21 46 70 89 107 121 131 136 138 138 137 136 0.4 Shearing force (N) 0 33 72 110 139 164 180 192 201 210 217 224 230 234 237 236 0 45...