3 ms·
I installed python and pandas > python >>> from random import random >>> import pandas as pd >>> random() 0.7077511922881649 >>> random() 0.25931
by ozark1 4y ago
I installed python and pandas
> python
>>> from random import random
>>> import pandas as pd
>>> random()
0.7077511922881649
>>> random()
0.2593136908764098
>>> data = [[random() for _ in range(5)] for _ in range(100)]
>>> data[0][0]
0.2735146614801971
>>> df = pd.DataFrame(data); df
0 1 2 3 4
0 0.273515 0.170594 0.898970 0.079374 0.928687
1 0.329525 0.636761 0.890724 0.943152 0.380383
2 0.467315 0.350110 0.466635 0.542507 0.374092
3 0.542107 0.099672 0.099831 0.951280 0.701957
4 0.720096 0.165341 0.552555 0.328817 0.472963
.. ... ... ... ... ...
95 0.055599 0.725660 0.501949 0.569756 0.224119
96 0.467840 0.489929 0.958574 0.021820 0.240163
97 0.354537 0.893724 0.924532 0.163044 0.184746
98 0.735890 0.186191 0.922227 0.283087 0.270254
99 0.480191 0.411743 0.930426 0.761544 0.344867
[100 rows x 5 columns]
>>> df.describe()
0 1 2 3 4
count 100.000000 100.00000 100.00000 100.00000 100.00000
mean 0.443366 0.47486 0.58345 0.50434 0.48321
std 0.270236 0.29132 0.28109 0.28135 0.26924
min 0.003486 0.00665 0.00926 0.00562 0.01362
25% 0.207259 0.18104 0.39012 0.26459 0.23753
50% 0.429908 0.46262 0.58884 0.51510 0.49547
75% 0.664791 0.68672 0.76128 0.73911 0.74120
max 0.937488 0.97642 0.98671 0.98319 0.98120
>>> data[5][0]
0.7057387521445215
>>> df.loc[5, 0]
0.7057387521445215