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 Data into Columns using pdfplumber arvin 17 5,673 Dec-17-2022, 11:59 AM
Last Post: arvin
  Showing an empty chart, then input data via function kgall89 0 991 Jun-02-2022, 01:53 AM
Last Post: kgall89
  Same Data Showing Several Times With Beautifulsoup Query eddywinch82 2 1,279 May-29-2022, 11:46 PM
Last Post: eddywinch82
  Showing data change korenron 10 2,629 Mar-20-2022, 01:50 PM
Last Post: korenron
  Extracting Data from tables DataExtrator 0 1,160 Nov-02-2021, 12:24 PM
Last Post: DataExtrator
  extracting data ajitnayak1987 1 1,556 Jul-29-2021, 06:13 AM
Last Post: bowlofred
  Extracting and printing data ajitnayak1987 0 1,425 Jul-28-2021, 09:30 AM
Last Post: ajitnayak1987
  Extracting unique pairs from a data set based on another value rybina 2 2,330 Feb-12-2021, 08:36 AM
Last Post: rybina
Thumbs Down extracting data/strings from Word doc mikkelibsen 1 1,953 Feb-10-2021, 11:06 AM
Last Post: Larz60+
  Extracting data from a website tgottsc1 2 2,286 Jan-09-2021, 08:14 PM
Last Post: tgottsc1

Forum Jump:

User Panel Messages

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