Popular cheeses recalled across the country over E.coli fears
by Shanee DobesonAn urgent recall has been issued for a number of cheeses over fears they could be contaminated with E. coli bacteria.
The Australian Competition and Consumer Commission alerted people to the recall of the 200g Udder Delights White Mould cheeses in a notice on Friday.
“The recall is due to Potential microbial (E.coli) contamination,” the recall notice reads.
“Food products contaminated with E.coli may cause illness if consumed.”
The affected products have been available for sale at Coles and independent retail stores in QLD, VIC, WA and SA, Coles, Woolworths and independent retail stores in NSW, and independent retail stores in SA and TAS.
We’re being urged to chuck out any of the cheeses with best before dates between the 29th of January and 5th of February 20-20.
“Any consumers concerned about their health should seek medical advice and should return the products to the place of purchase for a full refund,” the ACCC said.
Udder Delights is conducting a recall of:
Cremeux Brie
Cremeux Camembert
Cremeux Double Brie
Divine Dairy Organic Brie
Divine Dairy Organic Double Cream Brie
Shale Point Double Cream Camembert
Eureka Camembert
Udder Delights Ash Brie
Udder Delights Double Cream Brie
Udder Delights Camembert
Udder Delights Brie


Tutorial 02
Pre-requisites:
- Complete Tutorial 01 first.
Getting Started
- Download the source code from Github
- Open the solution
FleetClients.sln
in VS 2019
Tip
Ensure your fleet manager service is running and exposing endpoints on localhost.
Important
Check the http endpoint fleetManager.svc is active.
Run the Console application
Select Tutorial 02
as the startup project, build and run the solution.
A simple demo will run where a virtual vehicle is created with a pose of 0,0,0. Upon subscribing to fleet updates the state of the fleet will be continuously flushed to the console window.
Code Snippets
ICallbackClient
The IFleetManagerClient
implements the ICallbackClient
interface, in that it will automatically connect to the server and subscribe to fleet state update messages. When a new fleet state message is received, the FleetState
property will be updated and the event FleetStateUpdated
fired.
The ICallbackClient
interface defines two events:
event Action<DateTime> Connected;
event Action<DateTime> Disconnected;
Which will fire whenever the client is connected or disconnected from the server. In addition the IsConnected
property can be used to determine the state of the connection.
With the console app running and displaying the fleet state, stopping the Fleet Manager Service will result in the last received fleet state being displayed, e.g.
Fleet size:1
IP Address:<IP_ADDRESS> Tick:140, X:1, Y:1, Heading:1.57
Re-starting the Fleet Manager Service will result in:
Fleet size:0
being displayed as the fleet manager is re-initialized with no virtual vehicles.


Thami Cakes
At Thami Cakes, because we custom and hand make all of our cakes, we can do cakes in any theme or style. From matching cakes to your celebration theme, your invites; colour scheme or your special interests or hobbies no cake is too big or small, and any cake requirements can be discussed, designed and catered for. We have cake options in every price range and for every style, so whether you need to stick to a budget.
At Thami Cakes, because we custom and hand make all of our cakes, we can do cakes in any theme or style. From matching cakes to your celebration theme, your invites; colour scheme or your special interests or hobbies no cake is too big or small, and any cake requirements can be discussed, designed and catered for. We have cake options in every price range and for every style, so whether you need to stick to a budget.
Established for over 50 years, Keith Home Made Cakes still delivers a range of speciality cakes that is ideal for entertaining guests, a family treat or a little self indulgence. Our full team of chefs and friendly staff take pride in providing attentive service while discussing your needs for your special cake. While small we are big in service and satisfaction.
Our fully-customised, fun and friendly range of specialty cakes for children are guaranteed to bring a smile to the face of the birthday boy or girl .
For tea, school lunches, birthdays, weddings, baby showers and even corporate events, our cupcakes are the ideal treat for every occasion
About Us
At Thami Cakes, because we custom and hand make all of our cakes, we can do cakes in any theme or style. From matching cakes to your celebration theme, your invites; colour scheme or your special interests or hobbies no cake is too big or small, and any cake requirements can be discussed, designed and catered for. We have cake options in every price range and for every style, so whether you need to stick to a budget.
At Thami Cakes, because we custom and hand make all of our cakes, we can do cakes in any theme or style. From matching cakes to your celebration theme, your invites; colour scheme or your special interests or hobbies no cake is too big or small, and any cake requirements can be discussed, designed and catered for. We have cake options in every price range and for every style, so whether you need to stick to a budget.
Established for over 50 years, Keith Home Made Cakes still delivers a range of speciality cakes that is ideal for entertaining guests, a family treat or a little self indulgence. Our full team of chefs and friendly staff take pride in providing attentive service while discussing your needs for your special cake. While small we are big in service and satisfaction.
Our fully-customised, fun and friendly range of specialty cakes for children are guaranteed to bring a smile to the face of the birthday boy or girl .
For tea, school lunches, birthdays, weddings, baby showers and even corporate events, our cupcakes are the ideal treat for every occasion
Our Cakes
At Thami Cakes, because we custom and hand make all of our cakes, we can do cakes in any theme or style. From matching cakes to your celebration theme, your invites; colour scheme or your special interests or hobbies no cake is too big or small, and any cake requirements can be discussed, designed and catered for. We have cake options in every price range and for every style, so whether you need to stick to a budget.
At Thami Cakes, because we custom and hand make all of our cakes, we can do cakes in any theme or style. From matching cakes to your celebration theme, your invites; colour scheme or your special interests or hobbies no cake is too big or small, and any cake requirements can be discussed, designed and catered for. We have cake options in every price range and for every style, so whether you need to stick to a budget.
Gallery
Call Us
At Thami Cakes, because we custom and hand make all of our cakes, we can do cakes in any theme or style. From matching cakes to your celebration theme, your invites; colour scheme or your special interests or hobbies no cake is too big or small, and any cake requirements can be discussed, designed and catered for. We have cake options in every price range and for every style, so whether you need to stick to a budget.
At Thami Cakes, because we custom and hand make all of our cakes, we can do cakes in any theme or style. From matching cakes to your celebration theme, your invites; colour scheme or your special interests or hobbies no cake is too big or small, and any cake requirements can be discussed, designed and catered for. We have cake options in every price range and for every style, so whether you need to stick to a budget.


List of participants for whom accomodation is confirmed
- List of faculty for whom accomodation is confirmed:
| Attendee Name |
Guest House |
Check-in date |
Check-out date |
Occupancy |
| Lamba |
CVH |
20-02-2019 |
24-02-2019 |
Studio apartment |
| Maskara |
CVH |
20-02-2019 |
24-02-2019 |
Studio apartment |
| Sinha |
CVH |
21-02-2019 |
24-02-2019 |
Studio apartment |
| Sahasrabudhe |
CVH |
21-02-2019 |
23-02-2019 |
Studio apartment |
| Mrityunjoy |
CVH |
20-02-2019 |
23-02-2019 |
Studio apartment |
| Ashok Jhunjhunwala |
CVH |
21-02-2019 |
23-02-2019 |
Studio apartment |
| Vimal Bhatia |
CVH |
19-02-2019 |
21-02-2019 |
Studio apartment |
| Krishna Jagannathan, Prabha Mandayam |
CVH |
20-02-2019 |
23-02-2019 |
Studio apartment |
| PravasRanjan Sahu |
CVH |
19-02-2019 |
24-02-2019 |
Studio apartment |
| Sibi Raj B Pillai |
CVH |
20-02-2019 |
23-02-2019 |
Studio apartment |
| M D Selvaraj |
CVH |
22-02-2019 |
24-02-2019 |
Studio apartment |
| Ranjan Malick |
CVH |
20-02-2019 |
23-02-2019 |
Studio apartment |
| Meenakshi Rawat |
CVH |
19-02-2019 |
24-02-2019 |
Studio apartment |
| Subrat Kar |
CVH |
19-02-2019 |
24-02-2019 |
Studio apartment |
| Andrew Thangaraj |
JVH |
20-02-2019 |
23-02-2019 |
Twin sharing |
| Govind D |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| Trilochan Panigrahi |
JVH |
19-02-2019 |
24-02-2019 |
Twin sharing |
| Nandakumar Nambath |
JVH |
22-02-2019 |
23-02-2019 |
Twin sharing |
| Salil Kashyap |
JVH |
20-02-2019 |
23-02-2019 |
Twin sharing |
| Vineeth B S |
JVH |
19-02-2019 |
24-02-2019 |
Twin sharing |
| Vijay Kumar Chakka |
JVH |
20-02-2019 |
23-02-2019 |
Twin sharing |
| Hemnat Kumar Kathania |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| Dr. Abhishek Dixit |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| Sachin Chaudhari |
JVH |
20-02-2019 |
22-02-2019 |
Twin sharing |
| Sumohana S. Channappayya |
JVH |
22-02-2019 |
23-02-2019 |
Twin sharing |
| Bhabesh Deka |
JVH |
19-02-2019 |
24-02-2019 |
Twin sharing |
| Anil Prabhakar |
JVH |
20-02-2019 |
23-02-2019 |
Twin sharing |
| Prabhavathi P |
JVH |
20-02-2019 |
23-02-2019 |
Twin sharing |
| R. Manivasakan |
JVH |
21-02-2019 |
23-02-2019 |
Twin sharing |
| Samudravijaya K |
JVH |
21-02-2019 |
23-02-2019 |
Twin sharing |
| Krishna Moorthy Sivalingam |
JVH |
20-02-2019 |
23-02-2019 |
Twin sharing |
| Avhishek Chatterjee |
JVH |
19-02-2019 |
24-02-2019 |
Twin sharing |
| Lalitha Vadlamani |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| Anusuya B |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| Harika Arava |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| Vinodh R V |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| Ashish R Hota |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| K A Narayanan Kutty |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| Bheemarjuna Reddy Tamma |
JVH |
19-02-2019 |
23-02-2019 |
Twin sharing |
| Antony Franklin |
JVH |
21-02-2019 |
23-02-2019 |
Twin sharing |
| V Chandrasekhar |
JVH |
20-02-2019 |
22-02-2019 |
Twin sharing |
| Kavita gopal |
JVH |
19-02-2019 |
21-02-2019 |
Twin sharing |
| Sheetal Kalyani |
JVH |
21-02-2019 |
22-02-2019 |
Twin sharing |
| Bikash Kumar Dey |
JVH |
22-02-2019 |
23-02-2019 |
Twin sharing |
| Animesh Kumar |
JVH |
20-02-2019 |
21-02-2019 |
Twin sharing |
| Bharath B N |
JVH |
20-02-2019 |
23-02-2019 |
Twin sharing |
| Bijit Kumar Das |
JVH |
20-02-2019 |
23-02-2019 |
Twin sharing |
| Supriya Dilip Tambe |
JVH |
20-02-2019 |
24-02-2019 |
Twin sharing |
| Jyoti Tiwari |
JVH |
20-02-2019 |
24-02-2019 |
Twin sharing |
| Shwetha Vittal |
JVH |
20-02-2019 |
22-02-2019 |
Twin sharing |
| Priyank Naik |
JVH |
21-02-2019 |
23-02-2019 |
Twin sharing |
- List of students for whom accomodation is confirmed:
| Attendee Name |
Guest House |
Check-in date |
Check-out date |
Occupancy |
| Aditi Page |
Hoyasala |
19-02-2019 |
24-02-2019 |
Single |
| Manvi Nagdev |
Hoyasala |
19-02-2019 |
24-02-2019 |
Single |
| Anu Shaju Areeckal |
Hoyasala |
21-02-2019 |
21-02-2019 |
Single |
| Ragini Sinha |
Hoyasala |
20-02-2019 |
23-02-2019 |
Single |
| Shaifu Gupta |
Hoyasala |
21-02-2019 |
21-02-2019 |
Single |
| Shikha Gupta |
Hoyasala |
19-02-2019 |
21-02-2019 |
Single |
| Dhruti Shah |
Hoyasala |
21-02-2019 |
23-02-2019 |
Single |
| Jinia Aktar |
Hoyasala |
19-02-2019 |
24-02-2019 |
Single |
| Kancharla Parimala |
Hoyasala |
20-02-2019 |
23-02-2019 |
Single |
| Lakshmipriya Balagourouchetty |
Hoyasala |
20-02-2019 |
23-02-2019 |
Single |
| Madhuri Latha |
Hoyasala |
19-02-2019 |
23-02-2019 |
Single |
| Athisaya Anushya |
Hoyasala |
19-02-2019 |
23-02-2019 |
Single |
| Ragini Chaluvadi |
Hoyasala |
19-02-2019 |
23-02-2019 |
Single |
| Sonali |
Hoyasala |
20-02-2019 |
25-02-2019 |
Single |
| Akankshya Bhatta |
Hoyasala |
20-02-2019 |
23-02-2019 |
Single |
| Animesh Nighojkar |
Hoyasala |
22-02-2019 |
24-02-2019 |
Single |
CVH : Centenary Visitor's House
JVH : Jawahar Visitor's House
On-campus accommodation
Very limited on-campus accommodation is available in IISc. For availing this, accommodation requests have to made in at the time of registration. Note that this reservation is done in a first come first serve basis and we do not guarantee accomodation given the large number of participants and the limited availability on campus.
- For faculty, accommodation is available in the following guest houses:
- Centenary visitors guest house
- JNCSR guest house
- For students,
- Few rooms are available in the Hoysala guest house. (Preference will be given to girl students)
- The list of students to whom rooms are assigned has been announced on this web page
- We advise other students to book their accommodation at budget lodge/hotel given below
Rental charges for accomodation in IISc campus
- IISc Main Guest House
| AC |
2500/- per day |
| Non-AC |
1500/- per day |
- Centanary Visitor's House
| Studio Apartment |
1200/- per day |
| 1 Bed Room Apartment |
1500/- per day |
| 2 Bed Room Apartment |
2000/- per day |
- Hoysala House (Single person occupancy)
| Students |
300/- per day |
| Faculty |
1000/- per day |
| Industry people |
1500/- per day |
- Jawahar Visitor's House (Twin sharing rooms):
Rs.1000/- per day, per person + 12/% GST
Off-campus Accommodation
-
Krishinton Hotels (Just opposite of D-Gate IISc): For NCC delegates special discount is arranged. Please use the discount dode while booking online or contact the person below with a reference to IEEE NCC IISc. www.krishinton.com
Discount Code: IEEE-FEB-2019
Discounted rates are given bellow only for NCC GUESTS:
The Room tariff includes:
- Complimentary breakfast
- Complimentary usage of Wi-Fi internet
- Complimentary mineral water
- 24/7 Room service
- Complimentary newspaper
- Iron & iron board on request
- Tea/ coffee maker in all the rooms
Contact person for this hotel:
Anand Bandekar
Sales Manager, Hotel Krishinton Suites
#993-M.S.Ramaiah Main Road
Mathikere, Bangalore- 54
Mob:<PHONE_NUMBER>, Tel:<PHONE_NUMBER>9
Email ID :
<EMAIL_ADDRESS>-
The Chevron Hotels (Half a kilometer away from IISc campus) (www.thechevronhotels.com)
| Room Type |
Rack Rates |
Special Rates for NCC CONF |
|
Single |
Double |
Single |
Double |
| Executive |
5500+Tax |
6500+Tax |
Rs.2499+ GST |
Rs.3000+GST |
| Luxury |
7500+Tax |
8500+Tax |
Rs.3000 + GST |
Rs.3500+GST |
Note: The above Special Rate Includes:
- Complimentary breakfast, wifi, 12:00 noon check-in & checkout
- Usage of Wi-Fi
- Usage of Fitness centre
- 24/7 Room service
- Packaged drinking water on daily basis
- Special rates excludes GST as applicable
Contact person for this hotel:
Srinivas (Manager-Sales)
#137/7, 9th Main Road, 6th A Cross Street,
Sadashivnagar, Bangalore-560080
Ph: +91 80 40952266 Fax: +91 80 40952299
Mobile No: +91-9972202471.
Email ID:
<EMAIL_ADDRESS>www.thechevronhotels.com
Infantry Road, Brigade Road, Sadashivnagar.
- Budget Hotel/Lodge:
- Kaveri Deluxe Lodge (around 2km from campus): http://kaverilodge.bookingssafe.com
Starting: 850/- INR
Kaveri Deluxe Lodge, #19, SNR Plaza, Near Jain Temple, 1st Main Road, H Gurumurthy Reddy Colony, Yeshwanthpur, Bengaluru, Karnataka - 560022.
- Hotel Rathna Mahal Residency
Starting: 872/- INR
4th Cross, Sampige Road, Malleshwaram Circle, Near Shishu Vihar, Malleshwaram, Bengaluru, Karnataka - 560003 (Tele: 080 2356 2928).
- Maurya Paradise Inn (approximately 1km from campus)
Starting: 576/- INR
No:#7/1, MSR Engineering College Rd, Mathikere Extension, Devasandra Layout, Bengaluru, Karnataka - 560054 (080 4127 9589).
For accommodation related queries please write to hospitality.ncc2019@gmail.com


Mapping Source
This structure represents the following mapping definition:
plannet.PlanNet-PractitionerRole maps to http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole: Network maps to http://hl7.org/fhir/uv/vhdir/StructureDefinition/network-reference NewPatients maps to http://hl7.org/fhir/uv/vhdir/StructureDefinition/newpatients NewPatientProfile maps to http://hl7.org/fhir/uv/vhdir/StructureDefinition/newpatientprofile Qualification maps to http://hl7.org/fhir/uv/vhdir/StructureDefinition/qualification AvailableTime maps to http://hl7.org/fhir/uv/vhdir/StructureDefinition/contactpoint-availabletime ViaIntermediary maps to http://hl7.org/fhir/uv/vhdir/StructureDefinition/contactpoint-viaintermediary constrain active to 1..1 constrain code to 1..1


|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Layer
This interface defines all necessary methods for a neural network layer.
| Method Summary | |
|---|---|
void |
addNext(Layer next)
Add a layer to this layer. |
void |
addNext(Layer next,
SynapseType type)
Add a layer to this layer. |
void |
addSynapse(Synapse synapse)
This method adds a synapse to the neural network. |
NeuralData |
compute(NeuralData pattern)
Compute the output for this layer. |
ActivationFunction |
getActivationFunction()
|
double |
getBiasActivation()
Most layer types will default this value to one. |
double |
getBiasWeight(int index)
Get an bias weight value. |
double[] |
getBiasWeights()
|
int |
getID()
|
BasicNetwork |
getNetwork()
|
int |
getNeuronCount()
|
java.util.List<Synapse> |
getNext()
Get a list of all of the outbound synapse connections from this layer. |
java.util.Collection<Layer> |
getNextLayers()
|
int |
getX()
|
int |
getY()
|
boolean |
hasBias()
|
boolean |
isConnectedTo(Layer layer)
Determine if this layer is connected to another. |
void |
process(NeuralData pattern)
Process the data before it is modified by this layer. |
NeuralData |
recur()
Called on recurrent layers to provide recurrent output. |
void |
setActivationFunction(ActivationFunction activationFunction)
Set a new activation function for this layer. |
void |
setBiasActivation(double activation)
Most layer types will default this value to one. |
void |
setBiasWeight(int index,
double d)
Set an individual bias weight value. |
void |
setBiasWeights(double[] d)
Set the bias weight array for this layer. |
void |
setID(int id)
Set the id for this layer. |
void |
setNetwork(BasicNetwork network)
Set the network that this layer belongs to. |
void |
setNeuronCount(int neuronCount)
Set the neuron count, this will NOT adjust the synapses or bias weights other code must do that. |
void |
setX(int x)
Set the x coordinate. |
void |
setY(int y)
Set the y coordinate. |
| Methods inherited from interface org.encog.persist.EncogPersistedObject |
|---|
createPersistor, getCollection, getDescription, getName, setCollection, setDescription, setName |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Method Detail |
|---|
void addNext(Layer next)
next
- The layer that is to be added.void addNext(Layer next, SynapseType type)
next
- The layer that is to be added.type
- The type of synapse to add.void addSynapse(Synapse synapse)
synapse
- The synapse to add.NeuralData compute(NeuralData pattern)
pattern
- The input pattern.
ActivationFunction getActivationFunction()
int getID()
BasicNetwork getNetwork()
int getNeuronCount()
java.util.List<Synapse> getNext()
java.util.Collection<Layer> getNextLayers()
double[] getBiasWeights()
double getBiasWeight(int index)
index
- The bias value to get.
int getX()
int getY()
boolean hasBias()
boolean isConnectedTo(Layer layer)
layer
- The second layer, checked to see if it is connected to this
layer.
void process(NeuralData pattern)
pattern
- The pattern.NeuralData recur()
void setActivationFunction(ActivationFunction activationFunction)
activationFunction
- The new activation function.void setID(int id)
id
- The id for this layer.void setNetwork(BasicNetwork network)
network
- The network.void setNeuronCount(int neuronCount)
neuronCount
- The new neuron countvoid setBiasWeights(double[] d)
d
- The new bias weight array.void setBiasWeight(int index, double d)
index
- The index of the bias weight value.d
- The new bias weight value.void setX(int x)
x
- The x-coordinate.void setY(int y)
y
- The y-coordinate.void setBiasActivation(double activation)
activation
- The activation for the bias weights.double getBiasActivation()
|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


home
Departments
Computer Engineering
Computer Science
Software Engineering
Other Info
Fee Structure
Coming Soon
Scholarships
Contact Us
About Us
home
Departments
Computer Engineering
Computer Science
Software Engineering
Other Info
Fees Structure
Coming Soon
Scholarships
Contact Us
About Us
Attendance Submitted Successfully
Your Attendance has Already Submitted
back Camera
Submit Attendance


getValues(object, options) is similar to getValue(id, options) except that the input is a Javascript object that contains name/value pairs. The names are assumed to be the IDs of HTML elements, and the values are altered to reflect the contents of those IDs. This method does not return the object in question, it alters the value that you pass to it.
By default DWR protects against XSS in dwr.util.getValues by escaping potentially dangerous characters. The optional options object parameter allows output escaping to be disabled. Please see the escapeHtml page for more information.
dwr.util.getValues
(
)
This alters the object so that it looks like: (click the getValues button)
Note that the code here is being executed live, so try editing the input bean above, or the form below and watch how the output changes.
From DWR 1.1 getValues()
will also take an HTML element (either as a DOM object or an id string) from which it will generate a reply object.
HTML Test Elements
| Text area (id="textarea"): | Selection list (id="select"): | ||
| Text input (id="text"): | Password input (id="password"): | ||
| Form button (id="formbutton"): | Fancy button (id="button"): |


It started with the idea to be involved in the education nation, several people gathered and decided to have the responsibility in building the future of nation in 1979. They formed an education institution namely "Yayasan Dharmaputra." The objective of STMIK Dharma Putra has to be in line with the main purpose that is: to equip the graduates in advancing human and data resources in Tangerang. Kindergarten (Taman Kanak-Kanak) was a stepping stone progressing the idea to establish other units such as Junior High School (Sekolah Lanjutan Tingkat Pertama), Senior High School (Sekolah Menengah Umum) and STMIK (Sekolah Tinggi Manajemen Informatika dan Komputer) respectively. Therefore, the effort to improve the nation quality in education has been put.
SEKOLAH TINGGI MANAJEMEN INFORMATIKA DAN KOMPUTER
1. Founded in : 2003
2. Unit Status (Accreditation): Registered
3. Number of Students :
- Computer Science : 78 Students
- Information System : 88 Students
       To meet the future demand of professionals in Information Technology that is computer, STMIK Dharma Putra was officially opened on March 13th 2003. It was based on the decree No: 29 / D / 0 / 2003 which is expected to provide well-rounded computing professionals with sufficient knowledge of Computer Science and Information Technology needed in the fast-growing user community. Moreover, these skills and knowledge obtained in the program in computing will assist them to expand their career options. STMIK Dharma Putra allows the students to gain competences so that the graduates are able to participate in supporting the success of national development, especially the human resources in Tangerang. STMIK Dharma Putra has 2 (two) study programs:
1. The Study Program of Computer Science (S1)
2. Information System (S1):
- Information Management
- Computer Accounting


| Modifier and Type | Field and Description |
|---|---|
private Chromosome[] |
Main.chromos
A Chromosome array thet stores the chromosomes generated by the programs last
iteration
|
| Modifier and Type | Method and Description |
|---|---|
Chromosome[] |
Main.bestChromosomes(int amount)
A method to obtain the best chromosomes contained in
Main.chromos |
(package private) Chromosome |
Chromosome.crossOver(Chromosome parent,
double probability,
long STime,
int gen)
A method to cross the chromosome with another to create a child
|
Chromosome |
Main.getNewChromosome()
A method that creates a new Chromosome with birth generation equal to
Main.generationCounter 's current value |
(package private) Chromosome |
Chromosome.mutate(long STime,
double probability,
int gen)
A method to mutate the chromosome into a new one
|
(package private) Chromosome |
Chromosome.SetInitialTime(Chromosome chromo,
long Initial)
Setter for the
startTime of a given chromosome |
private Chromosome[] |
Main.setNextGeneration()
A method to obtain
Main.chromos ' next generation |
| Modifier and Type | Method and Description |
|---|---|
(package private) Chromosome |
Chromosome.crossOver(Chromosome parent,
double probability,
long STime,
int gen)
A method to cross the chromosome with another to create a child
|
(package private) Chromosome |
Chromosome.SetInitialTime(Chromosome chromo,
long Initial)
Setter for the
startTime of a given chromosome |


In this section, we will discuss missing (also referred to as NA) values in pandas.
Note
The choice of using NaN internally to denote missing data was largely for simplicity and performance reasons. Starting from pandas 1.0, some optional data types start experimenting with a native NA scalar using a mask-based approach. See here for more.
NaN
NA
See the cookbook for some advanced strategies.
As data comes in many shapes and forms, pandas aims to be flexible with regard to handling missing data. While NaN is the default missing value marker for reasons of computational speed and convenience, we need to be able to easily detect this value with data of different types: floating point, integer, boolean, and general object. In many cases, however, the Python None will arise and we wish to also consider that “missing” or “not available” or “NA”.
None
If you want to consider inf and -inf to be “NA” in computations, you can set pandas.options.mode.use_inf_as_na = True.
inf
-inf
pandas.options.mode.use_inf_as_na = True
In [1]: df = pd.DataFrame(np.random.randn(5, 3), index=['a', 'c', 'e', 'f', 'h'], ...: columns=['one', 'two', 'three']) ...: In [2]: df['four'] = 'bar' In [3]: df['five'] = df['one'] > 0 In [4]: df Out[4]: one two three four five a 0.469112 -0.282863 -1.509059 bar True c -1.135632 1.212112 -0.173215 bar False e 0.119209 -1.044236 -0.861849 bar True f -2.104569 -0.494929 1.071804 bar False h 0.721555 -0.706771 -1.039575 bar True In [5]: df2 = df.reindex(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']) In [6]: df2 Out[6]: one two three four five a 0.469112 -0.282863 -1.509059 bar True b NaN NaN NaN NaN NaN c -1.135632 1.212112 -0.173215 bar False d NaN NaN NaN NaN NaN e 0.119209 -1.044236 -0.861849 bar True f -2.104569 -0.494929 1.071804 bar False g NaN NaN NaN NaN NaN h 0.721555 -0.706771 -1.039575 bar True
To make detecting missing values easier (and across different array dtypes), pandas provides the isna() and notna() functions, which are also methods on Series and DataFrame objects:
isna()
notna()
In [7]: df2['one'] Out[7]: a 0.469112 b NaN c -1.135632 d NaN e 0.119209 f -2.104569 g NaN h 0.721555 Name: one, dtype: float64 In [8]: pd.isna(df2['one']) Out[8]: a False b True c False d True e False f False g True h False Name: one, dtype: bool In [9]: df2['four'].notna() Out[9]: a True b False c True d False e True f True g False h True Name: four, dtype: bool In [10]: df2.isna() Out[10]: one two three four five a False False False False False b True True True True True c False False False False False d True True True True True e False False False False False f False False False False False g True True True True True h False False False False False
Warning
One has to be mindful that in Python (and NumPy), the nan's don’t compare equal, but None's do. Note that pandas/NumPy uses the fact that np.nan != np.nan, and treats None like np.nan.
nan's
None's
np.nan != np.nan
np.nan
In [11]: None == None # noqa: E711 Out[11]: True In [12]: np.nan == np.nan Out[12]: False
So as compared to above, a scalar equality comparison versus a None/np.nan doesn’t provide useful information.
None/np.nan
In [13]: df2['one'] == np.nan Out[13]: a False b False c False d False e False f False g False h False Name: one, dtype: bool
Because NaN is a float, a column of integers with even one missing values is cast to floating-point dtype (see Support for integer NA for more). Pandas provides a nullable integer array, which can be used by explicitly requesting the dtype:
In [14]: pd.Series([1, 2, np.nan, 4], dtype=pd.Int64Dtype()) Out[14]: 0 1 1 2 2 <NA> 3 4 dtype: Int64
Alternatively, the string alias dtype='Int64' (note the capital "I") can be used.
dtype='Int64'
"I"
See Nullable integer data type for more.
For datetime64[ns] types, NaT represents missing values. This is a pseudo-native sentinel value that can be represented by NumPy in a singular dtype (datetime64[ns]). pandas objects provide compatibility between NaT and NaN.
NaT
In [15]: df2 = df.copy() In [16]: df2['timestamp'] = pd.Timestamp('20120101') In [17]: df2 Out[17]: one two three four five timestamp a 0.469112 -0.282863 -1.509059 bar True 2012-01-01 c -1.135632 1.212112 -0.173215 bar False 2012-01-01 e 0.119209 -1.044236 -0.861849 bar True 2012-01-01 f -2.104569 -0.494929 1.071804 bar False 2012-01-01 h 0.721555 -0.706771 -1.039575 bar True 2012-01-01 In [18]: df2.loc[['a', 'c', 'h'], ['one', 'timestamp']] = np.nan In [19]: df2 Out[19]: one two three four five timestamp a NaN -0.282863 -1.509059 bar True NaT c NaN 1.212112 -0.173215 bar False NaT e 0.119209 -1.044236 -0.861849 bar True 2012-01-01 f -2.104569 -0.494929 1.071804 bar False 2012-01-01 h NaN -0.706771 -1.039575 bar True NaT In [20]: df2.dtypes.value_counts() Out[20]: float64 3 datetime64[ns] 1 object 1 bool 1 dtype: int64
You can insert missing values by simply assigning to containers. The actual missing value used will be chosen based on the dtype.
For example, numeric containers will always use NaN regardless of the missing value type chosen:
In [21]: s = pd.Series([1, 2, 3]) In [22]: s.loc[0] = None In [23]: s Out[23]: 0 NaN 1 2.0 2 3.0 dtype: float64
Likewise, datetime containers will always use NaT.
For object containers, pandas will use the value given:
In [24]: s = pd.Series(["a", "b", "c"]) In [25]: s.loc[0] = None In [26]: s.loc[1] = np.nan In [27]: s Out[27]: 0 None 1 NaN 2 c dtype: object
Missing values propagate naturally through arithmetic operations between pandas objects.
In [28]: a Out[28]: one two a NaN -0.282863 c NaN 1.212112 e 0.119209 -1.044236 f -2.104569 -0.494929 h -2.104569 -0.706771 In [29]: b Out[29]: one two three a NaN -0.282863 -1.509059 c NaN 1.212112 -0.173215 e 0.119209 -1.044236 -0.861849 f -2.104569 -0.494929 1.071804 h NaN -0.706771 -1.039575 In [30]: a + b Out[30]: one three two a NaN NaN -0.565727 c NaN NaN 2.424224 e 0.238417 NaN -2.088472 f -4.209138 NaN -0.989859 h NaN NaN -1.413542
The descriptive statistics and computational methods discussed in the data structure overview (and listed here and here) are all written to account for missing data. For example:
When summing data, NA (missing) values will be treated as zero.
If the data are all NA, the result will be 0.
Cumulative methods like cumsum() and cumprod() ignore NA values by default, but preserve them in the resulting arrays. To override this behaviour and include NA values, use skipna=False.
cumsum()
cumprod()
skipna=False
In [31]: df Out[31]: one two three a NaN -0.282863 -1.509059 c NaN 1.212112 -0.173215 e 0.119209 -1.044236 -0.861849 f -2.104569 -0.494929 1.071804 h NaN -0.706771 -1.039575 In [32]: df['one'].sum() Out[32]: -1.9853605075978744 In [33]: df.mean(1) Out[33]: a -0.895961 c 0.519449 e -0.595625 f -0.509232 h -0.873173 dtype: float64 In [34]: df.cumsum() Out[34]: one two three a NaN -0.282863 -1.509059 c NaN 0.929249 -1.682273 e 0.119209 -0.114987 -2.544122 f -1.985361 -0.609917 -1.472318 h NaN -1.316688 -2.511893 In [35]: df.cumsum(skipna=False) Out[35]: one two three a NaN -0.282863 -1.509059 c NaN 0.929249 -1.682273 e NaN -0.114987 -2.544122 f NaN -0.609917 -1.472318 h NaN -1.316688 -2.511893
This behavior is now standard as of v0.22.0 and is consistent with the default in numpy; previously sum/prod of all-NA or empty Series/DataFrames would return NaN. See v0.22.0 whatsnew for more.
numpy
The sum of an empty or all-NA Series or column of a DataFrame is 0.
In [36]: pd.Series([np.nan]).sum() Out[36]: 0.0 In [37]: pd.Series([], dtype="float64").sum() Out[37]: 0.0
The product of an empty or all-NA Series or column of a DataFrame is 1.
In [38]: pd.Series([np.nan]).prod() Out[38]: 1.0 In [39]: pd.Series([], dtype="float64").prod() Out[39]: 1.0
NA groups in GroupBy are automatically excluded. This behavior is consistent with R, for example:
In [40]: df Out[40]: one two three a NaN -0.282863 -1.509059 c NaN 1.212112 -0.173215 e 0.119209 -1.044236 -0.861849 f -2.104569 -0.494929 1.071804 h NaN -0.706771 -1.039575 In [41]: df.groupby('one').mean() Out[41]: two three one -2.104569 -0.494929 1.071804 0.119209 -1.044236 -0.861849
See the groupby section here for more information.
pandas objects are equipped with various data manipulation methods for dealing with missing data.
fillna() can “fill in” NA values with non-NA data in a couple of ways, which we illustrate:
fillna()
Replace NA with a scalar value
In [42]: df2 Out[42]: one two three four five timestamp a NaN -0.282863 -1.509059 bar True NaT c NaN 1.212112 -0.173215 bar False NaT e 0.119209 -1.044236 -0.861849 bar True 2012-01-01 f -2.104569 -0.494929 1.071804 bar False 2012-01-01 h NaN -0.706771 -1.039575 bar True NaT In [43]: df2.fillna(0) Out[43]: one two three four five timestamp a 0.000000 -0.282863 -1.509059 bar True 0 c 0.000000 1.212112 -0.173215 bar False 0 e 0.119209 -1.044236 -0.861849 bar True 2012-01-01 00:00:00 f -2.104569 -0.494929 1.071804 bar False 2012-01-01 00:00:00 h 0.000000 -0.706771 -1.039575 bar True 0 In [44]: df2['one'].fillna('missing') Out[44]: a missing c missing e 0.119209 f -2.10457 h missing Name: one, dtype: object
Fill gaps forward or backward
Using the same filling arguments as reindexing, we can propagate non-NA values forward or backward:
In [45]: df Out[45]: one two three a NaN -0.282863 -1.509059 c NaN 1.212112 -0.173215 e 0.119209 -1.044236 -0.861849 f -2.104569 -0.494929 1.071804 h NaN -0.706771 -1.039575 In [46]: df.fillna(method='pad') Out[46]: one two three a NaN -0.282863 -1.509059 c NaN 1.212112 -0.173215 e 0.119209 -1.044236 -0.861849 f -2.104569 -0.494929 1.071804 h -2.104569 -0.706771 -1.039575
Limit the amount of filling
If we only want consecutive gaps filled up to a certain number of data points, we can use the limit keyword:
In [47]: df Out[47]: one two three a NaN -0.282863 -1.509059 c NaN 1.212112 -0.173215 e NaN NaN NaN f NaN NaN NaN h NaN -0.706771 -1.039575 In [48]: df.fillna(method='pad', limit=1) Out[48]: one two three a NaN -0.282863 -1.509059 c NaN 1.212112 -0.173215 e NaN 1.212112 -0.173215 f NaN NaN NaN h NaN -0.706771 -1.039575
To remind you, these are the available filling methods:
Method
Action
pad / ffill
Fill values forward
bfill / backfill
Fill values backward
With time series data, using pad/ffill is extremely common so that the “last known value” is available at every time point.
ffill() is equivalent to fillna(method='ffill') and bfill() is equivalent to fillna(method='bfill')
ffill()
fillna(method='ffill')
bfill()
fillna(method='bfill')
You can also fillna using a dict or Series that is alignable. The labels of the dict or index of the Series must match the columns of the frame you wish to fill. The use case of this is to fill a DataFrame with the mean of that column.
In [49]: dff = pd.DataFrame(np.random.randn(10, 3), columns=list('ABC')) In [50]: dff.iloc[3:5, 0] = np.nan In [51]: dff.iloc[4:6, 1] = np.nan In [52]: dff.iloc[5:8, 2] = np.nan In [53]: dff Out[53]: A B C 0 0.271860 -0.424972 0.567020 1 0.276232 -1.087401 -0.673690 2 0.113648 -1.478427 0.524988 3 NaN 0.577046 -1.715002 4 NaN NaN -1.157892 5 -1.344312 NaN NaN 6 -0.109050 1.643563 NaN 7 0.357021 -0.674600 NaN 8 -0.968914 -1.294524 0.413738 9 0.276662 -0.472035 -0.013960 In [54]: dff.fillna(dff.mean()) Out[54]: A B C 0 0.271860 -0.424972 0.567020 1 0.276232 -1.087401 -0.673690 2 0.113648 -1.478427 0.524988 3 -0.140857 0.577046 -1.715002 4 -0.140857 -0.401419 -1.157892 5 -1.344312 -0.401419 -0.293543 6 -0.109050 1.643563 -0.293543 7 0.357021 -0.674600 -0.293543 8 -0.968914 -1.294524 0.413738 9 0.276662 -0.472035 -0.013960 In [55]: dff.fillna(dff.mean()['B':'C']) Out[55]: A B C 0 0.271860 -0.424972 0.567020 1 0.276232 -1.087401 -0.673690 2 0.113648 -1.478427 0.524988 3 NaN 0.577046 -1.715002 4 NaN -0.401419 -1.157892 5 -1.344312 -0.401419 -0.293543 6 -0.109050 1.643563 -0.293543 7 0.357021 -0.674600 -0.293543 8 -0.968914 -1.294524 0.413738 9 0.276662 -0.472035 -0.013960
Same result as above, but is aligning the ‘fill’ value which is a Series in this case.
In [56]: dff.where(pd.notna(dff), dff.mean(), axis='columns') Out[56]: A B C 0 0.271860 -0.424972 0.567020 1 0.276232 -1.087401 -0.673690 2 0.113648 -1.478427 0.524988 3 -0.140857 0.577046 -1.715002 4 -0.140857 -0.401419 -1.157892 5 -1.344312 -0.401419 -0.293543 6 -0.109050 1.643563 -0.293543 7 0.357021 -0.674600 -0.293543 8 -0.968914 -1.294524 0.413738 9 0.276662 -0.472035 -0.013960
You may wish to simply exclude labels from a data set which refer to missing data. To do this, use dropna():
dropna()
In [57]: df Out[57]: one two three a NaN -0.282863 -1.509059 c NaN 1.212112 -0.173215 e NaN 0.000000 0.000000 f NaN 0.000000 0.000000 h NaN -0.706771 -1.039575 In [58]: df.dropna(axis=0) Out[58]: Empty DataFrame Columns: [one, two, three] Index: [] In [59]: df.dropna(axis=1) Out[59]: two three a -0.282863 -1.509059 c 1.212112 -0.173215 e 0.000000 0.000000 f 0.000000 0.000000 h -0.706771 -1.039575 In [60]: df['one'].dropna() Out[60]: Series([], Name: one, dtype: float64)
An equivalent dropna() is available for Series. DataFrame.dropna has considerably more options than Series.dropna, which can be examined in the API.
New in version 0.23.0: The limit_area keyword argument was added.
limit_area
Both Series and DataFrame objects have interpolate() that, by default, performs linear interpolation at missing data points.
interpolate()
In [61]: ts Out[61]: 2000-01-31 0.469112 2000-02-29 NaN 2000-03-31 NaN 2000-04-28 NaN 2000-05-31 NaN ... 2007-12-31 -6.950267 2008-01-31 -7.904475 2008-02-29 -6.441779 2008-03-31 -8.184940 2008-04-30 -9.011531 Freq: BM, Length: 100, dtype: float64 In [62]: ts.count() Out[62]: 66 In [63]: ts.plot() Out[63]: <matplotlib.axes._subplots.AxesSubplot at 0x7f2cca34ff10>
In [64]: ts.interpolate() Out[64]: 2000-01-31 0.469112 2000-02-29 0.434469 2000-03-31 0.399826 2000-04-28 0.365184 2000-05-31 0.330541 ... 2007-12-31 -6.950267 2008-01-31 -7.904475 2008-02-29 -6.441779 2008-03-31 -8.184940 2008-04-30 -9.011531 Freq: BM, Length: 100, dtype: float64 In [65]: ts.interpolate().count() Out[65]: 100 In [66]: ts.interpolate().plot() Out[66]: <matplotlib.axes._subplots.AxesSubplot at 0x7f2cca547790>
Index aware interpolation is available via the method keyword:
method
In [67]: ts2 Out[67]: 2000-01-31 0.469112 2000-02-29 NaN 2002-07-31 -5.785037 2005-01-31 NaN 2008-04-30 -9.011531 dtype: float64 In [68]: ts2.interpolate() Out[68]: 2000-01-31 0.469112 2000-02-29 -2.657962 2002-07-31 -5.785037 2005-01-31 -7.398284 2008-04-30 -9.011531 dtype: float64 In [69]: ts2.interpolate(method='time') Out[69]: 2000-01-31 0.469112 2000-02-29 0.270241 2002-07-31 -5.785037 2005-01-31 -7.190866 2008-04-30 -9.011531 dtype: float64
For a floating-point index, use method='values':
method='values'
In [70]: ser Out[70]: 0.0 0.0 1.0 NaN 10.0 10.0 dtype: float64 In [71]: ser.interpolate() Out[71]: 0.0 0.0 1.0 5.0 10.0 10.0 dtype: float64 In [72]: ser.interpolate(method='values') Out[72]: 0.0 0.0 1.0 1.0 10.0 10.0 dtype: float64
You can also interpolate with a DataFrame:
In [73]: df = pd.DataFrame({'A': [1, 2.1, np.nan, 4.7, 5.6, 6.8], ....: 'B': [.25, np.nan, np.nan, 4, 12.2, 14.4]}) ....: In [74]: df Out[74]: A B 0 1.0 0.25 1 2.1 NaN 2 NaN NaN 3 4.7 4.00 4 5.6 12.20 5 6.8 14.40 In [75]: df.interpolate() Out[75]: A B 0 1.0 0.25 1 2.1 1.50 2 3.4 2.75 3 4.7 4.00 4 5.6 12.20 5 6.8 14.40
The method argument gives access to fancier interpolation methods. If you have scipy installed, you can pass the name of a 1-d interpolation routine to method. You’ll want to consult the full scipy interpolation documentation and reference guide for details. The appropriate interpolation method will depend on the type of data you are working with.
If you are dealing with a time series that is growing at an increasing rate, method='quadratic' may be appropriate.
method='quadratic'
If you have values approximating a cumulative distribution function, then method='pchip' should work well.
method='pchip'
To fill missing values with goal of smooth plotting, consider method='akima'.
method='akima'
These methods require scipy.
scipy
In [76]: df.interpolate(method='barycentric') Out[76]: A B 0 1.00 0.250 1 2.10 -7.660 2 3.53 -4.515 3 4.70 4.000 4 5.60 12.200 5 6.80 14.400 In [77]: df.interpolate(method='pchip') Out[77]: A B 0 1.00000 0.250000 1 2.10000 0.672808 2 3.43454 1.928950 3 4.70000 4.000000 4 5.60000 12.200000 5 6.80000 14.400000 In [78]: df.interpolate(method='akima') Out[78]: A B 0 1.000000 0.250000 1 2.100000 -0.873316 2 3.406667 0.320034 3 4.700000 4.000000 4 5.600000 12.200000 5 6.800000 14.400000
When interpolating via a polynomial or spline approximation, you must also specify the degree or order of the approximation:
In [79]: df.interpolate(method='spline', order=2) Out[79]: A B 0 1.000000 0.250000 1 2.100000 -0.428598 2 3.404545 1.206900 3 4.700000 4.000000 4 5.600000 12.200000 5 6.800000 14.400000 In [80]: df.interpolate(method='polynomial', order=2) Out[80]: A B 0 1.000000 0.250000 1 2.100000 -2.703846 2 3.451351 -1.453846 3 4.700000 4.000000 4 5.600000 12.200000 5 6.800000 14.400000
Compare several methods:
In [81]: np.random.seed(2) In [82]: ser = pd.Series(np.arange(1, 10.1, .25) ** 2 + np.random.randn(37)) In [83]: missing = np.array([4, 13, 14, 15, 16, 17, 18, 20, 29]) In [84]: ser[missing] = np.nan In [85]: methods = ['linear', 'quadratic', 'cubic'] In [86]: df = pd.DataFrame({m: ser.interpolate(method=m) for m in methods}) In [87]: df.plot() Out[87]: <matplotlib.axes._subplots.AxesSubplot at 0x7f2cca3215d0>
Another use case is interpolation at new values. Suppose you have 100 observations from some distribution. And let’s suppose that you’re particularly interested in what’s happening around the middle. You can mix pandas’ reindex and interpolate methods to interpolate at the new values.
reindex
interpolate
In [88]: ser = pd.Series(np.sort(np.random.uniform(size=100))) # interpolate at new_index In [89]: new_index = ser.index | pd.Index([49.25, 49.5, 49.75, 50.25, 50.5, 50.75]) In [90]: interp_s = ser.reindex(new_index).interpolate(method='pchip') In [91]: interp_s[49:51] Out[91]: 49.00 0.471410 49.25 0.476841 49.50 0.481780 49.75 0.485998 50.00 0.489266 50.25 0.491814 50.50 0.493995 50.75 0.495763 51.00 0.497074 dtype: float64
Like other pandas fill methods, interpolate() accepts a limit keyword argument. Use this argument to limit the number of consecutive NaN values filled since the last valid observation:
limit
In [92]: ser = pd.Series([np.nan, np.nan, 5, np.nan, np.nan, ....: np.nan, 13, np.nan, np.nan]) ....: In [93]: ser Out[93]: 0 NaN 1 NaN 2 5.0 3 NaN 4 NaN 5 NaN 6 13.0 7 NaN 8 NaN dtype: float64 # fill all consecutive values in a forward direction In [94]: ser.interpolate() Out[94]: 0 NaN 1 NaN 2 5.0 3 7.0 4 9.0 5 11.0 6 13.0 7 13.0 8 13.0 dtype: float64 # fill one consecutive value in a forward direction In [95]: ser.interpolate(limit=1) Out[95]: 0 NaN 1 NaN 2 5.0 3 7.0 4 NaN 5 NaN 6 13.0 7 13.0 8 NaN dtype: float64
By default, NaN values are filled in a forward direction. Use limit_direction parameter to fill backward or from both directions.
forward
limit_direction
backward
both
# fill one consecutive value backwards In [96]: ser.interpolate(limit=1, limit_direction='backward') Out[96]: 0 NaN 1 5.0 2 5.0 3 NaN 4 NaN 5 11.0 6 13.0 7 NaN 8 NaN dtype: float64 # fill one consecutive value in both directions In [97]: ser.interpolate(limit=1, limit_direction='both') Out[97]: 0 NaN 1 5.0 2 5.0 3 7.0 4 NaN 5 11.0 6 13.0 7 13.0 8 NaN dtype: float64 # fill all consecutive values in both directions In [98]: ser.interpolate(limit_direction='both') Out[98]: 0 5.0 1 5.0 2 5.0 3 7.0 4 9.0 5 11.0 6 13.0 7 13.0 8 13.0 dtype: float64
By default, NaN values are filled whether they are inside (surrounded by) existing valid values, or outside existing valid values. Introduced in v0.23 the limit_area parameter restricts filling to either inside or outside values.
# fill one consecutive inside value in both directions In [99]: ser.interpolate(limit_direction='both', limit_area='inside', limit=1) Out[99]: 0 NaN 1 NaN 2 5.0 3 7.0 4 NaN 5 11.0 6 13.0 7 NaN 8 NaN dtype: float64 # fill all consecutive outside values backward In [100]: ser.interpolate(limit_direction='backward', limit_area='outside') Out[100]: 0 5.0 1 5.0 2 5.0 3 NaN 4 NaN 5 NaN 6 13.0 7 NaN 8 NaN dtype: float64 # fill all consecutive outside values in both directions In [101]: ser.interpolate(limit_direction='both', limit_area='outside') Out[101]: 0 5.0 1 5.0 2 5.0 3 NaN 4 NaN 5 NaN 6 13.0 7 13.0 8 13.0 dtype: float64
Often times we want to replace arbitrary values with other values.
replace() in Series and replace() in DataFrame provides an efficient yet flexible way to perform such replacements.
replace()
For a Series, you can replace a single value or a list of values by another value:
In [102]: ser = pd.Series([0., 1., 2., 3., 4.]) In [103]: ser.replace(0, 5) Out[103]: 0 5.0 1 1.0 2 2.0 3 3.0 4 4.0 dtype: float64
You can replace a list of values by a list of other values:
In [104]: ser.replace([0, 1, 2, 3, 4], [4, 3, 2, 1, 0]) Out[104]: 0 4.0 1 3.0 2 2.0 3 1.0 4 0.0 dtype: float64
You can also specify a mapping dict:
In [105]: ser.replace({0: 10, 1: 100}) Out[105]: 0 10.0 1 100.0 2 2.0 3 3.0 4 4.0 dtype: float64
For a DataFrame, you can specify individual values by column:
In [106]: df = pd.DataFrame({'a': [0, 1, 2, 3, 4], 'b': [5, 6, 7, 8, 9]}) In [107]: df.replace({'a': 0, 'b': 5}, 100) Out[107]: a b 0 100 100 1 1 6 2 2 7 3 3 8 4 4 9
Instead of replacing with specified values, you can treat all given values as missing and interpolate over them:
In [108]: ser.replace([1, 2, 3], method='pad') Out[108]: 0 0.0 1 0.0 2 0.0 3 0.0 4 4.0 dtype: float64
Python strings prefixed with the r character such as r'hello world' are so-called “raw” strings. They have different semantics regarding backslashes than strings without this prefix. Backslashes in raw strings will be interpreted as an escaped backslash, e.g., r'\' == '\\'. You should read about them if this is unclear.
r
r'hello world'
r'\' == '\\'
Replace the ‘.’ with NaN (str -> str):
In [109]: d = {'a': list(range(4)), 'b': list('ab..'), 'c': ['a', 'b', np.nan, 'd']} In [110]: df = pd.DataFrame(d) In [111]: df.replace('.', np.nan) Out[111]: a b c 0 0 a a 1 1 b b 2 2 NaN NaN 3 3 NaN d
Now do it with a regular expression that removes surrounding whitespace (regex -> regex):
In [112]: df.replace(r'\s*\.\s*', np.nan, regex=True) Out[112]: a b c 0 0 a a 1 1 b b 2 2 NaN NaN 3 3 NaN d
Replace a few different values (list -> list):
In [113]: df.replace(['a', '.'], ['b', np.nan]) Out[113]: a b c 0 0 b b 1 1 b b 2 2 NaN NaN 3 3 NaN d
list of regex -> list of regex:
In [114]: df.replace([r'\.', r'(a)'], ['dot', r'\1stuff'], regex=True) Out[114]: a b c 0 0 astuff astuff 1 1 b b 2 2 dot NaN 3 3 dot d
Only search in column 'b' (dict -> dict):
'b'
In [115]: df.replace({'b': '.'}, {'b': np.nan}) Out[115]: a b c 0 0 a a 1 1 b b 2 2 NaN NaN 3 3 NaN d
Same as the previous example, but use a regular expression for searching instead (dict of regex -> dict):
In [116]: df.replace({'b': r'\s*\.\s*'}, {'b': np.nan}, regex=True) Out[116]: a b c 0 0 a a 1 1 b b 2 2 NaN NaN 3 3 NaN d
You can pass nested dictionaries of regular expressions that use regex=True:
regex=True
In [117]: df.replace({'b': {'b': r''}}, regex=True) Out[117]: a b c 0 0 a a 1 1 b 2 2 . NaN 3 3 . d
Alternatively, you can pass the nested dictionary like so:
In [118]: df.replace(regex={'b': {r'\s*\.\s*': np.nan}}) Out[118]: a b c 0 0 a a 1 1 b b 2 2 NaN NaN 3 3 NaN d
You can also use the group of a regular expression match when replacing (dict of regex -> dict of regex), this works for lists as well.
In [119]: df.replace({'b': r'\s*(\.)\s*'}, {'b': r'\1ty'}, regex=True) Out[119]: a b c 0 0 a a 1 1 b b 2 2 .ty NaN 3 3 .ty d
You can pass a list of regular expressions, of which those that match will be replaced with a scalar (list of regex -> regex).
In [120]: df.replace([r'\s*\.\s*', r'a|b'], np.nan, regex=True) Out[120]: a b c 0 0 NaN NaN 1 1 NaN NaN 2 2 NaN NaN 3 3 NaN d
All of the regular expression examples can also be passed with the to_replace argument as the regex argument. In this case the value argument must be passed explicitly by name or regex must be a nested dictionary. The previous example, in this case, would then be:
to_replace
regex
value
In [121]: df.replace(regex=[r'\s*\.\s*', r'a|b'], value=np.nan) Out[121]: a b c 0 0 NaN NaN 1 1 NaN NaN 2 2 NaN NaN 3 3 NaN d
This can be convenient if you do not want to pass regex=True every time you want to use a regular expression.
Anywhere in the above replace examples that you see a regular expression a compiled regular expression is valid as well.
replace
replace() is similar to fillna().
In [122]: df = pd.DataFrame(np.random.randn(10, 2)) In [123]: df[np.random.rand(df.shape[0]) > 0.5] = 1.5 In [124]: df.replace(1.5, np.nan) Out[124]: 0 1 0 -0.844214 -1.021415 1 0.432396 -0.323580 2 0.423825 0.799180 3 1.262614 0.751965 4 NaN NaN 5 NaN NaN 6 -0.498174 -1.060799 7 0.591667 -0.183257 8 1.019855 -1.482465 9 NaN NaN
Replacing more than one value is possible by passing a list.
In [125]: df00 = df.iloc[0, 0] In [126]: df.replace([1.5, df00], [np.nan, 'a']) Out[126]: 0 1 0 a -1.02141 1 0.432396 -0.32358 2 0.423825 0.79918 3 1.26261 0.751965 4 NaN NaN 5 NaN NaN 6 -0.498174 -1.0608 7 0.591667 -0.183257 8 1.01985 -1.48247 9 NaN NaN In [127]: df[1].dtype Out[127]: dtype('float64')
You can also operate on the DataFrame in place:
In [128]: df.replace(1.5, np.nan, inplace=True)
When replacing multiple bool or datetime64 objects, the first argument to replace (to_replace) must match the type of the value being replaced. For example,
bool
datetime64
>>> s = pd.Series([True, False, True]) >>> s.replace({'a string': 'new value', True: False}) # raises TypeError: Cannot compare types 'ndarray(dtype=bool)' and 'str'
will raise a TypeError because one of the dict keys is not of the correct type for replacement.
TypeError
dict
However, when replacing a single object such as,
In [129]: s = pd.Series([True, False, True]) In [130]: s.replace('a string', 'another string') Out[130]: 0 True 1 False 2 True dtype: bool
the original NDFrame object will be returned untouched. We’re working on unifying this API, but for backwards compatibility reasons we cannot break the latter behavior. See GH6354 for more details.
NDFrame
While pandas supports storing arrays of integer and boolean type, these types are not capable of storing missing data. Until we can switch to using a native NA type in NumPy, we’ve established some “casting rules”. When a reindexing operation introduces missing data, the Series will be cast according to the rules introduced in the table below.
data type
Cast to
integer
float
boolean
object
no cast
For example:
In [131]: s = pd.Series(np.random.randn(5), index=[0, 2, 4, 6, 7]) In [132]: s > 0 Out[132]: 0 True 2 True 4 True 6 True 7 True dtype: bool In [133]: (s > 0).dtype Out[133]: dtype('bool') In [134]: crit = (s > 0).reindex(list(range(8))) In [135]: crit Out[135]: 0 True 1 NaN 2 True 3 NaN 4 True 5 NaN 6 True 7 True dtype: object In [136]: crit.dtype Out[136]: dtype('O')
Ordinarily NumPy will complain if you try to use an object array (even if it contains boolean values) instead of a boolean array to get or set values from an ndarray (e.g. selecting values based on some criteria). If a boolean vector contains NAs, an exception will be generated:
In [137]: reindexed = s.reindex(list(range(8))).fillna(0) In [138]: reindexed[crit] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-138-0dac417a4890> in <module> ----> 1 reindexed[crit] ~/Documents/repositories/pandas/pandas/core/series.py in __getitem__(self, key) 846 key = list(key) 847 --> 848 if com.is_bool_indexer(key): 849 key = check_bool_indexer(self.index, key) 850 ~/Documents/repositories/pandas/pandas/core/common.py in is_bool_indexer(key) 134 if not lib.is_bool_array(key): 135 if isna(key).any(): --> 136 raise ValueError(na_msg) 137 return False 138 return True ValueError: cannot mask with array containing NA / NaN values
However, these can be filled in using fillna() and it will work fine:
In [139]: reindexed[crit.fillna(False)] Out[139]: 0 0.126504 2 0.696198 4 0.697416 6 0.601516 7 0.003659 dtype: float64 In [140]: reindexed[crit.fillna(True)] Out[140]: 0 0.126504 1 0.000000 2 0.696198 3 0.000000 4 0.697416 5 0.000000 6 0.601516 7 0.003659 dtype: float64
Pandas provides a nullable integer dtype, but you must explicitly request it when creating the series or column. Notice that we use a capital “I” in the dtype="Int64".
dtype="Int64"
In [141]: s = pd.Series([0, 1, np.nan, 3, 4], dtype="Int64") In [142]: s Out[142]: 0 0 1 1 2 <NA> 3 3 4 4 dtype: Int64
Experimental: the behaviour of pd.NA can still change without warning.
pd.NA
New in version 1.0.0.
Starting from pandas 1.0, an experimental pd.NA value (singleton) is available to represent scalar missing values. At this moment, it is used in the nullable integer, boolean and dedicated string data types as the missing value indicator.
The goal of pd.NA is provide a “missing” indicator that can be used consistently across data types (instead of np.nan, None or pd.NaT depending on the data type).
pd.NaT
For example, when having missing values in a Series with the nullable integer dtype, it will use pd.NA:
In [143]: s = pd.Series([1, 2, None], dtype="Int64") In [144]: s Out[144]: 0 1 1 2 2 <NA> dtype: Int64 In [145]: s[2] Out[145]: <NA> In [146]: s[2] is pd.NA Out[146]: True
Currently, pandas does not yet use those data types by default (when creating a DataFrame or Series, or when reading in data), so you need to specify the dtype explicitly.
In general, missing values propagate in operations involving pd.NA. When one of the operands is unknown, the outcome of the operation is also unknown.
For example, pd.NA propagates in arithmetic operations, similarly to np.nan:
In [147]: pd.NA + 1 Out[147]: <NA> In [148]: "a" * pd.NA Out[148]: <NA>
There are a few special cases when the result is known, even when one of the operands is NA.
In [149]: pd.NA ** 0 Out[149]: 1 In [150]: 1 ** pd.NA Out[150]: 1
In equality and comparison operations, pd.NA also propagates. This deviates from the behaviour of np.nan, where comparisons with np.nan always return False.
False
In [151]: pd.NA == 1 Out[151]: <NA> In [152]: pd.NA == pd.NA Out[152]: <NA> In [153]: pd.NA < 2.5 Out[153]: <NA>
To check if a value is equal to pd.NA, the isna() function can be used:
In [154]: pd.isna(pd.NA) Out[154]: True
An exception on this basic propagation rule are reductions (such as the mean or the minimum), where pandas defaults to skipping missing values. See above for more.
For logical operations, pd.NA follows the rules of the three-valued logic (or Kleene logic, similarly to R, SQL and Julia). This logic means to only propagate missing values when it is logically required.
For example, for the logical “or” operation (|), if one of the operands is True, we already know the result will be True, regardless of the other value (so regardless the missing value would be True or False). In this case, pd.NA does not propagate:
|
True
In [155]: True | False Out[155]: True In [156]: True | pd.NA Out[156]: True In [157]: pd.NA | True Out[157]: True
On the other hand, if one of the operands is False, the result depends on the value of the other operand. Therefore, in this case pd.NA propagates:
In [158]: False | True Out[158]: True In [159]: False | False Out[159]: False In [160]: False | pd.NA Out[160]: <NA>
The behaviour of the logical “and” operation (&) can be derived using similar logic (where now pd.NA will not propagate if one of the operands is already False):
&
In [161]: False & True Out[161]: False In [162]: False & False Out[162]: False In [163]: False & pd.NA Out[163]: False
In [164]: True & True Out[164]: True In [165]: True & False Out[165]: False In [166]: True & pd.NA Out[166]: <NA>
Since the actual value of an NA is unknown, it is ambiguous to convert NA to a boolean value. The following raises an error:
In [167]: bool(pd.NA) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-167-5477a57d5abb> in <module> ----> 1 bool(pd.NA) ~/Documents/repositories/pandas/pandas/_libs/missing.pyx in pandas._libs.missing.NAType.__bool__() TypeError: boolean value of NA is ambiguous
This also means that pd.NA cannot be used in a context where it is evaluated to a boolean, such as if condition: ... where condition can potentially be pd.NA. In such cases, isna() can be used to check for pd.NA or condition being pd.NA can be avoided, for example by filling missing values beforehand.
if condition: ...
condition
A similar situation occurs when using Series or DataFrame objects in if statements, see Using if/truth statements with pandas.
if
pandas.NA implements NumPy’s __array_ufunc__ protocol. Most ufuncs work with NA, and generally return NA:
pandas.NA
__array_ufunc__
In [168]: np.log(pd.NA) Out[168]: <NA> In [169]: np.add(pd.NA, 1) Out[169]: <NA>
Currently, ufuncs involving an ndarray and NA will return an object-dtype filled with NA values.
In [170]: a = np.array([1, 2, 3]) In [171]: np.greater(a, pd.NA) Out[171]: array([<NA>, <NA>, <NA>], dtype=object)
The return type here may change to return a different array type in the future.
See DataFrame interoperability with NumPy functions for more on ufuncs.


{{'Thank you for ordering' | translate}}
{{'Bank Account' | translate}}: {{info.storebank}}
{{'Bank Message' | translate }}: {{'Your order id is' | translate }} {{orderID}}
{{'We are going to call you soon' | translate }}
{{'If you have any comments or suggestions for us. please call our contact with your order id. We value your feedback' | translate }}


@@include('./components/head.html')
Sign Up
@@include('./components/nav/index.html')
How to use our feed
@@include('./components/assets/divider.html')
@@include('./components/assets/grass-row-blue-dark.html')
@@include('./components/footer/index.html')