Python Forum
use of In[] tag in pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use of In[] tag in pandas
#1
I was going through this code related to linear regression and was trying same in IDLE but idle is not recognizing Out[X,Y] or In[X] . Pandas moudle is already installed and imported in my .py file.
code is something like this

Out[142]:(24,24)
In[143]:plt.scatter(xs,ys) 


its gives me error

NameError: name 'In' is not defined

sameerror comes for 'Out' too.

Any help appreciated.
Reply
#2
IDLE is a poor excuse for an IDE and shouldn't be used as it has many issues. (Yours may or may not be one)
You should use another IDE, VS Code is very popular, just started using it myself after a long waltz with PyCharm,
and think it's great.
There are many others, see: https://www.google.com/search?source=hp&...for+python
Reply
#3
In and Out are objects of iPython REPL:
  • In is a list of typed commands
  • Out is a dictionary of outputs(stdout)- not objects

They will not be available in a script - only in iPython-based REPL.

You can use strings from In instead of retyping commands.

I personally recommend using online Azure Notebooks - this is link to one of mine.



I have forgotten to add - In and Out have nothing to do with pandas (in case it was unclear from the message above).
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Forum Jump:

User Panel Messages

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