Python Forum
Looping Through Large Data Sets
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looping Through Large Data Sets
#7
Hi Buran

Thank you for your response.

I think I understand, if no column names are specified in the dataframe then the values in the square brackets are the column index numbers.

If column names are specified then the name of the column needs to be included inside the square brackets - would this be correct?

I personally prefer to use row and column index numbers through the iloc command:-
 df_raw_data.iloc[:,5] = df_raw_data.iloc[:,3] * 1760 + df_raw_data.iloc[:,4] 
But i guess both achieve the same thing.

Although the change you suggested which was to add the column names works:-
raw_data['Column_5'] = raw_data['Column_3'] * 8950 + raw_data['Column_4']
This works however the arithmetic does not for example the values in column 5 is 2182181218218..., the code just copies the value from Column3 8950 times???

I am not certain why this is?
Reply


Messages In This Thread
Looping Through Large Data Sets - by JoeDainton123 - Oct-02-2020, 06:59 PM
RE: Looping Through Large Data Sets - by buran - Oct-02-2020, 07:07 PM
RE: Looping Through Large Data Sets - by buran - Oct-03-2020, 04:06 AM
RE: Looping Through Large Data Sets - by buran - Oct-17-2020, 06:27 AM
RE: Looping Through Large Data Sets - by JoeDainton123 - Oct-17-2020, 11:13 AM
RE: Looping Through Large Data Sets - by buran - Oct-17-2020, 02:44 PM
RE: Looping Through Large Data Sets - by jefsummers - Oct-18-2020, 12:53 PM
RE: Looping Through Large Data Sets - by buran - Oct-18-2020, 02:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Peculiar pattern from printing of sets SahandJ 7 1,708 Dec-29-2021, 06:31 PM
Last Post: bowlofred
  How does one combine 2 data sets ? detlefschmitt 2 1,717 Sep-03-2021, 03:38 AM
Last Post: detlefschmitt
  Looping to read data in database CEC68 1 1,739 Sep-24-2020, 08:54 PM
Last Post: scidam
  comprehension for sets Skaperen 2 1,877 Aug-07-2020, 10:12 PM
Last Post: Skaperen
  Extract data from large string pzig98 1 2,147 Jul-20-2020, 12:39 AM
Last Post: Larz60+
  Moving large amount of data between MySql and Sql Server using Python ste80adr 4 3,459 Apr-24-2020, 01:24 PM
Last Post: Jeff900
  alternative to nested loops for large data set JonnyEnglish 2 2,601 Feb-19-2020, 11:26 PM
Last Post: JonnyEnglish
  Looping JSON data graham23s 1 2,078 Jul-01-2019, 09:37 PM
Last Post: nilamo
  Sort sets by item values Sergey 4 75,153 Apr-19-2019, 10:50 AM
Last Post: Sergey
  Problem with character sets Pedroski55 4 3,776 Mar-04-2019, 02:35 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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