I m trying to group the data into different small DataFrames in pandas such that each Dataframe consists of 2 cabin crew,1 pilot and 1 first officer such that they are present in same base and fleet ,if not selecting positions from nearest base ,as I am new to ML and python I require help
position fleet base
cabin crew Airbus LHR
pilot Airbus LHR
firstofficer Airbus HKJ
cabin crew Airbus MUC
cabin crew Airbus LHR
pilot Airbus LHR
firstofficer Airbus HKJ
cabin crew Airbus MUC
cabin crew Airbus LHR
pilot Airbus LHR
firstofficer Airbus HKJ
cabin crew Airbus MUC
Related
Am looking to create a multi layer dropdown solution for selecting addresses, where the dropdowns options change based on prior selections.
E.g - Selection options are Region, Country, City, Address Line 1
The ask is that if someone selects Region EMEA, the country list should show only countries in EMEA. They then select a country and the city lists only those pertaining to that country.
The issue I think may be how the source data is structured, but hoping there may be a solution without have to alter the source information. If that's not possible, then any solution that works is great.
Preferably this will not use VBA. It can be used initially to structure the data, but not for the dropdowns to operate in use as the file will uploaded to Excel Online.
The structure of the address data is as follows as an example:
REGION
COUNTRY
CITY
ADDRESS LINE 1
APAC
Australia
Adelaide
12 Fairview Road
APAC
New Zealand
Auckland
1313 Cambridge Drive
EMEA
UK
London
24 Sycamore Street
EMEA
UK
London
25 Madison Avenue
EMEA
Spain
Madrid
567 Mulberry Street
APAC
New Zealand
Auckland
2345 George Street
APAC
India
Dehli
322 Locust Street
APAC
India
Dehli
12 Beech Street
APAC
India
Punjab
55 Route 7
LATAM
Brazil
Sao Paulo
7 Arch Street
I have a spreadsheet that looks like this
State
City
WA
Seattle
WA
Seattle
WA
Yakama
OR
Portland
OR
Albany
NY
Albany
OR
Portland
I want to count the duplicates but only for the times that BOTH columns are the same value, I would like the output to give me this info
State
City
Count
WA
Seattle
3
WA
Yakama
1
OR
Portland
2
OR
Albany
1
NY
Albany
1
I know this should be simple but I am having trouble finding this exact question elsewhere... thanks
You have a couple options.
Solution 1: Formulas
First copy and paste your state and city to new columns, then dedupe them using the Data tab. Then here's the formula for cell F3:
=COUNTIFS(A:A,D3,B:B,E3)
Solution 2: Pivot Table
Create a pivot off your data. Rows would be State and City. Values is Count of Whatever (city for example). Change your design to Tabular, repeat all labels, do not show grand or subtotals.
Just for fun a Microsoft365 solution (assuming you made a typo in your sample data):
=CHOOSE({1,2,3},UNIQUE(A2:B8),INDEX(UNIQUE(A2:B8),0,2),COUNTIFS(A2:A8,INDEX(UNIQUE(A2:B8),0,1),B2:B8,INDEX(UNIQUE(A2:B8),0,2)))
I'm not really sure of the proper terms here so I didn't know how to search for an answer.
I have a csv file with information presented in the following way:
Carrier
State
Aetna Health and Life Insurance Company (AHLIC)
IOWA
Aetna Health and Life Insurance Company (AHLIC)
ARIZONA
Aetna Health and Life Insurance Company (AHLIC)
UTAH
Aetna
CALIFORNIA
Aetna
TEXAS
Aetna
IDAHO
Humana
UTAH
Humana
FLORIDA
Humana
GEOLRGIA
I need the information to be presented like so:
Carrier
State
Aetna Health and Life Insurance Company (AHLIC)
IOWA, ARIZONA, UTAH
Aetna
CALIFORNIA, TEXAS, IDAHO
Humana
UTAH, FLORIDA, GEORGIA
My table has about 2000 rows so I'd prefer to not do it completely manually. What would the best way to accomplish this be?
If you have access to the new array formulas
To get your list of unique values in the first column
=UNIQUE(A2:A10)
And to join the values associated with each unique value
=TEXTJOIN(", ",TRUE,FILTER(B:B,A:A=D2,""))
Have tried all online advice. Cannot get Pivot table data to sum. Have 2 columns that begin:
7847050 CANADA INC 4.50
ACADEMY OF MANAGEMENT (NY) 16.50
ALM MEDIA PROPERTIES, LLC 3.50
AMERICAN ACADEMY OF SLEEP MEDICINE 21.50
AMERICAN ASSOCIATION FOR CANCER RESEARCH 36.50
AMERICAN ASSOCIATION OF CLINICAL ENDOCRINOLOGISTS (AACE) 16.50
AMERICAN ASSOCIATION OF PETROLEUM GEOLOGISTS 9.50
AMERICAN CHEMICAL SOCIETY 42.50
AMERICAN CHEMICAL SOCIETY 42.50
AMERICAN DIABETES ASSOCIATION 21.50
Have tried all advice re putting numbers in number format. Multiplied by 1, text to table etc. Just get zeroes for the sum column. Help!
I have this data in an Excel spreadsheet. I want to sort the data in ascending order using Column 1 and want to keep the respective columns in order. The first 6 data is to be sorted first and then the next 11 data. I have similar kind of huge set of data with different sizes which i want to sort in Excel.
Can anyone guide me on the efficient method to do this?
2 1101 TATE'S CAIRN TUNNEL
3 12406 WATER SPORTS CENTRE
4 12407 HONG KONG INSTITUTE OF BIOTECHNOLOGY
5 12408 HONG KONG SCIENCE PARK
6 13183 HONG KONG SCIENCE PARK PHASE III
1 1146 DIAMOND HILL RAILWAY STATION BUS TERMINUS
6 6588 FANLING RAILWAY STATION
7 6582 PAK FUK TIN SUM PLAYGROUND
8 6579 DAWNING VIEWS
9 6575 WO HING TSUEN
10 6585 WAH MING BUS TERMINUS
11 6586 WAH MING BUS TERMINUS
1 6586 WAH MING BUS TERMINUS
2 6584 YAN SHING COURT
3 6589 FUNG YING SIN KOON
4 6591 KEI SAN SECONDARY SCHOOL
5 6590 KEI SAN SECONDARY SCHOOL
Highlight/Select the range to be sorted.
Click on Data tab.
Click on Sort and follow the Wizard's instructions. Which includes choosing what columns to sort on etc.