Python Forum
Running Standard Scaler in Python 3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running Standard Scaler in Python 3
#2
It is telling you that you cannot do this:
df3=pd.DataFrame(None)
Which is what you are doing because df2 == None. df2 == None because you cannot do this:
df2 = df.drop(["Unnamed: 0", "timestamp"], axis=1, inplace=True)
From the pandas documentation
https://pandas.pydata.org/pandas-docs/st....drop.html
Quote:inplacebool, default False
If False, return a copy. Otherwise, do operation inplace and return None.
So either you can do this:
df2 = df.drop(["Unnamed: 0", "timestamp"], axis=1)
Or you can do this:
df.drop(["Unnamed: 0", "timestamp"], axis=1, inplace=True)
Assignment of the result, and using "inplace=True" can never be used together
Reply


Messages In This Thread
RE: Running Standard Scaler in Python 3 - by deanhystad - Sep-05-2022, 06:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python standard way of importing library mg24 1 978 Nov-15-2022, 01:41 AM
Last Post: deanhystad
  Scaler fit with different colums HoldYourBreath 0 1,395 Jan-10-2021, 11:53 AM
Last Post: HoldYourBreath
  Winsorized Mean and Standard Deviation Wheeliam 0 1,879 Jul-11-2020, 05:27 PM
Last Post: Wheeliam
  standard library modules chpyel 4 2,932 May-10-2020, 02:58 PM
Last Post: snippsat
  Is there a standard for autocommit In PEP 249 zatlas1 10 5,477 Feb-06-2019, 04:56 PM
Last Post: buran
  Graphics and standard deviation rocioaraneda 3 2,805 Jan-09-2019, 10:53 PM
Last Post: micseydel
  standard data types rombertus 3 77,723 Dec-23-2018, 08:52 PM
Last Post: rombertus
  Fatal Python error: init_sys_streams: can't initialize sys standard streams Attribute FatalPythonError 24 58,986 Aug-22-2018, 06:10 PM
Last Post: FatalPythonError
  Join the Python Standard Library to my project sylas 1 2,246 May-16-2018, 05:59 AM
Last Post: buran
  Do you know how to import Python Standard Library sylas 30 14,608 Jan-26-2018, 01:32 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

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