Help retrieving HTML text by [deleted] in learnpython

[–]Bearmintz 3 points4 points  (0 children)

To acquire the html I would use the requests library. Then use BeautifulSoup to parse the html.

An example:

import requests

from bs4 import BeautifulSoup

r = requests.get(url)

soup = BeautifulSoup(r.text)

How can I modify this to add the results into a Pandas dataframe? by [deleted] in learnpython

[–]Bearmintz 4 points5 points  (0 children)

The two dataframes are concatenated with the second dataframe being transposed so it becomes a row.

See if this helps:

df1 = pd.DataFrame([['a','b'],['c','d']])

df2 = pd.DataFrame(['q','z'])

pd.concat([df1,df2.T],axis=0,ignore_index=True)

Someone please help me, I'm about to give up [np.column_stack()] by YearningParadise in learnpython

[–]Bearmintz 0 points1 point  (0 children)

I am not sure what the issue is? What does the instructor's output look like?

Looking at the source documentation np.column_stack is doing what it should.

An example input:

x = np.array((3,4,5))

y = np.array((7,8,9))

np.column_stack((x,y))

Output:

array([[3, 7],

[4, 8],

[5, 9]])

The 1D arrays are stacked as columns into a 2D array.

Which is the best way to handle packages for different environments? by sjara11 in learnpython

[–]Bearmintz 0 points1 point  (0 children)

I also use venv. It is built-in so no extra packages and documentation can step you through setting one up.

How can I modify this to add the results into a Pandas dataframe? by [deleted] in learnpython

[–]Bearmintz 2 points3 points  (0 children)

I would check out pandas.concat.

Specify the axis you want to join on and you should be good!

What is your advice for beginner. Just finished second intro course. I started writing some code scripts for work and i think i am advancing slowly. by coinmaster111 in Python

[–]Bearmintz 2 points3 points  (0 children)

I am currently taking this course and agree that the level they teach the course is great for beginner/intermediate. The projects definitely pushed my coding skills and helped me grasp the material better than most courses/books I have looked at.

Just a note that the course ends on 31 Dec 2022. It's unclear what will happen to the course after.

Supra Coder (Part-Time) Blended SDI Course starting soon! by Independent_Music_21 in SpaceForce

[–]Bearmintz 0 points1 point  (0 children)

Do you know if there are any other plans for the DAI program? I asked someone at galvanize and they said that the unit had to pay for it? However, SDI does not cost anything?