+ 4
[SOLVED] Question for Python Experts
The program below is quite long and a bit complex, it's a personal project based on Chapter 8 Exercise 15 from Starting Out with Python by Tony Gaddis, for reference. I would really love any help from Python experts on how to simplify any lines of code. This would help me become a better programmer and learn more about the Python libraries. If you wish to look up the challenge, just search up Gas Prices Tony Gaddis Python 5th Edition. Hopefully this discussion isn't too much. Keep in mind the code doesn't work on SoloLearn IDE. You can try it on PyCharm and use the GasPrices.txt file. DM if you need it, but you can also find it online. https://code.sololearn.com/cw6fe3y935pC/?ref=app
38 Antworten
+ 3
Abdul rahmon I posted a link to that book here.
Why not check it out?
+ 5
Chris das ist dein Namensvetter, mit dem ich dich verwechselt habe.
+ 4
Chris not only this:
Make a list from it with 4 rows: day,month,year,price.
(ok...no pandas)
+ 4
am glad I commented here , seeing this discussion notification keep motivating me
thanks you'all
+ 3
#Chris
sorry for interrupting , you mentioned (Starting out with python by Tony Gaddis) in your description , as a beginner can go for that
+ 3
Bob_Li yeah... that's how It will work..
But in his book, he just worked on files, strings, 2dLists...
In short time this stuff is his reading.
+ 3
Oma Falk
Agreed. Writing it from scratch is a good way to learn how code works.
But he will outgrow it sooner or later.
Just giving a preview on the convenience of using modules made specifically for the task required.
+ 3
kindly resend the link
I think click the wrong link
please
+ 3
Bob_Li Damn I need to learn Pandas!
+ 3
Chris
Don't worry, it gets harder, then easier. The knowledge builds upon one another.
+ 2
Chris ,
can you give us a sample how the file for reading from looks like. it contains date and price, but how date and price are formatted?
+ 2
Hi, I made it work on SL
https://code.sololearn.com/cG5D36YNCKsN/?ref=app
+ 2
There are tons of improvements, but we should take into account, you are beginner.
Lisa an all our data scientists would do it in 5 lines.
But... your way does the job.
+ 2
Chris
Pandas have a big learning curve, but here is an idea on how to use it for your data:
https://code.sololearn.com/cLZmCFVjCX90/?ref=app
+ 2
Abdul rahmon It's working, at least on mobile. I downloaded it actually along with the rest. (Great link lol thanks Oma Falk)
What signup are you talking about btw? That link directs you to a professor's course material directory.
+ 2
Bob_Li And data structures and algorithms, boy do I have so much to learn.
+ 2
Thanks you guys , I finished the course , now I understand what you posted ,thanks once more for sharing the pdf with me
I'll be glad if you share more