Python Forum
What are these python lines for? What are tey doing?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What are these python lines for? What are tey doing?
#4
Quote:I noticed that there is more space inside the bracket in in line 15 than in line 16. Why is that?
You are mistaken. Spacing is the same in both lines.
X = data.iloc[:, :8].values
Y = data.iloc[:, 8].values.reshape(-1,1)
#               ^ one space
Did you look at my example? I demonstrated the difference between lines 15 and 16 here:
evaluate("First three columns", "df.iloc[:, :3]")   # Does the same thing as line 15
evaluate("Column 2 (third column)", "df.iloc[:, 2]")  # Does the same thing as line 16
Reply


Messages In This Thread
RE: What are these python lines for? What are tey doing? - by deanhystad - Feb-10-2023, 10:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python seems to be skipping lines of code alansandbucket 1 4,248 Jun-22-2021, 01:18 AM
Last Post: Larz60+
  Iterate 2 large text files across lines and replace lines in second file medatib531 13 6,121 Aug-10-2020, 11:01 PM
Last Post: medatib531
  How to re run lines in python? MrDoggo124 5 4,645 May-19-2019, 06:29 PM
Last Post: MrDoggo124
  Arrange lines in python pythonlover 11 7,384 Sep-15-2017, 11:34 PM
Last Post: pythonlover
  parallel(offset) lines using python johnfriend 1 4,343 May-05-2017, 06:10 AM
Last Post: buran

Forum Jump:

User Panel Messages

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