Python Forum
numpy and statistics module
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
numpy and statistics module
#3
statistics was new in version 3.4.
So use Python 3.6, Win, Linux.

There are several problem with that code.
No need to use Numpy,if use statistics.
Numpy has own statistics.
Need to convert to integers.
import statistics

rawstr1 = input("type a 4-list of integers: ")
rawstr2 = input("type a 4-list of integers: ")
ival1 = [int(i) for i in list(rawstr1)]
ival2 = [int(i) for i in list(rawstr2)]
print(statistics.stdev(ival1 + ival2))
Output:
E:\1py_div\div_code λ python num.py type a 4-list of integers: 1234 type a 4-list of integers: 4567 2.0
Reply


Messages In This Thread
numpy and statistics module - by baronmontesqieu - Sep-18-2017, 09:57 AM
RE: numpy and statistics module - by Larz60+ - Sep-18-2017, 10:25 AM
RE: numpy and statistics module - by snippsat - Sep-18-2017, 12:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 701 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,672 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  AttributeError: module 'numpy' has no attribute 'array aapurdel 7 45,794 May-29-2019, 02:48 AM
Last Post: heiner55
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 3,028 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  No module named numpy rdx 7 59,259 Sep-24-2017, 07:12 AM
Last Post: Larz60+
  Statistics: Two histograms based on word frequency vectors fancy_panther 2 4,788 Mar-27-2017, 01:18 AM
Last Post: zivoni

Forum Jump:

User Panel Messages

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