Python Forum
Extracting data without showing dtype, name etc.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extracting data without showing dtype, name etc.
#1
Hello,

I have a basic question and would be happy if someone could help me out.

I've extracted the prices of 2 stocks (Varta and Softcat) from a website using the following code:

import pandas as pd
# Get data from website
url = 'https://www.ariva.de/varta-aktie/kurs'
df = pd.read_html(url)
# Select table
df_Varta = df[3]
url = 'https://www.ariva.de/softcat-aktie/kurs'
df = pd.read_html(url)
df_Softcat = df[3]
# Extract price from column/ row 
price_Varta= df_Varta['Letzter'][df_Varta['Handelsplatz']=='Xetra']
price_Softcat= df_Softcat['Letzter'][df_Softcat['Handelsplatz']=='L&S RT']

print(price_Varta)
print(price_Softcat)
The code generates the following output:

Output:
5 126,90 € Name: Letzter, dtype: object 0 16,825 € Name: Letzter, dtype: object
However, I only want to know the price (without row numbers, name or dtype). Has anyone an idea how to achieve this result?

Many thanks in advance!

Best,

Tim
Reply


Messages In This Thread
Extracting data without showing dtype, name etc. - by tgottsc1 - Jan-10-2021, 11:14 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting the correct data from a CSV file S2G 6 345 Jun-03-2024, 04:50 PM
Last Post: snippsat
  What's the meaning of dtype=mesh.Mesh.dtype? FerdiFuchs 2 317 May-10-2024, 11:39 AM
Last Post: FerdiFuchs
  Extracting Data into Columns using pdfplumber arvin 17 6,201 Dec-17-2022, 11:59 AM
Last Post: arvin
  Showing an empty chart, then input data via function kgall89 0 1,046 Jun-02-2022, 01:53 AM
Last Post: kgall89
  Same Data Showing Several Times With Beautifulsoup Query eddywinch82 2 1,336 May-29-2022, 11:46 PM
Last Post: eddywinch82
  Showing data change korenron 10 2,830 Mar-20-2022, 01:50 PM
Last Post: korenron
  Extracting Data from tables DataExtrator 0 1,208 Nov-02-2021, 12:24 PM
Last Post: DataExtrator
  extracting data ajitnayak1987 1 1,624 Jul-29-2021, 06:13 AM
Last Post: bowlofred
  Extracting and printing data ajitnayak1987 0 1,468 Jul-28-2021, 09:30 AM
Last Post: ajitnayak1987
  Extracting unique pairs from a data set based on another value rybina 2 2,419 Feb-12-2021, 08:36 AM
Last Post: rybina

Forum Jump:

User Panel Messages

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