Skip to main content

Posts

Showing posts from March, 2021

Pandas Introduction, Data Selection using pandas

It is the upper layer of NumPy that has been created by the NumPy library, pandas are used to provide data operation, data selection, and data structure similar to SQL query of the database. How to install pandas in the machine? pip install pandas conda instal pandas Pandas provide two different types of Objects:- 1)  Series: - Series is called Single Dimension Array that is used to contain labeled data under array objects. It is also used to implement numerical operations similar to NumPy array but it is used to implement calculation on Dataframe columns. Example 1st:- Create Script to display data on series Without label import pandas as pd import numpy as np arr = np.array([12,23,34,56,89,11]) data = pd.Series(arr) print(data) Create Script to display data on series With label import pandas as pd import numpy as np arr = np.array([12,23,34,56,89,11]) data = pd.Series(arr,index=['P','q','r','s','t','u']) print(data) Create Series with L...

Write data on CSV format using pandas from DataFrame?

If we want to convert application data into CSV format under data science then we can use to_csv(). Syntax   df = pd.DataFrame( dict ) # saving the dataframe df.to_csv( 'filename.csv' )     Now I am creating dictionary objects to store student records that will be saved into CSV file using data frames. import pandas as pd stu = {'rno':[1001,1002,1003],'sname':['stu1','stu2','stu3']} df=pd.DataFrame(stu) df.to_csv('stu.csv') ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, If we want to write a CSV file without an index or Without a Column Header then we can use the following property. df = pd.DataFrame( dict ) # saving the dataframe df.to_csv( 'file2.csv' , header = False , index = False ) Example without header and indexing? import pandas as pd stu = {'rno':[1001,1002,1003],'sname':['stu...

What is Node JS? Node JS Introduction

Node Js is the runtime environment that provide the advanced dynamic library of Javascript that is used to manage dynamic operation using JS module with NPM(node package manager), it is used to implement server side operation using javascript language, it create API that can be used into REAT, Angular based  application. NODE js is the primary layer of angular and react application, without node environment we can not create the flexible API for React and Angular application. Node JS also used to handle file handling operations, it can read, write, append data from text files and binary files. NODE js is mainly used to connect data from database servers such as Mongo DB and MYSQL. NODE Js contain internal compiler chrome V8 Javascript engine to run the script , it  save the file using .js or .ts extension. Now I am providing the first program of Node Js to print hello world? Step1st:- Install Node Js in Machine using the following link            ...

How to create module in Node Js to implement functionality?

Module:- The module is used to contain the set of functions to implement functionality that can be called under node js main file. exports.functionname=   function() {       return statements; } How to call module under node js main file. var http = require('http'); var ref = require('./modulename'); http.createServer(function (req, res) {   res.writeHead(200, {'Content-Type': 'text/html'});   res.write("hello" + ref.methodame());   res.end(); }).listen(8080); console.log("Program started at localhost 8080");

Consume Rest API using AXIOS library in React-JS

AXIOS is another approach to consume rest API in react-js, it provides async and awaits () to call multiple rest API simultaneous. It also provides promise-based API communication from the client machine to the server machine.no need to convert response data to JSON, it will automatically return JSON type data. AXIOS library support on all web browsers and older versions also because it has no in-built API tools on browser. It takes more process time as compared to the Fetch method but it provides better security as compare to Fetch. It has CSRF features to protect cross-site URL protection. FEATURES OF AXIOS Request and response interception Streamlined error handling Protection against  XSRF Support for upload progress Response timeout The ability to cancel requests Support for older browsers Automatic JSON data transformation How to use it 1)  install axios library in React-JS   npm install axios Syntax pattern to use it axios.get(apiUrl).then((repos) => {   ...

Job alert for Python, PHP, Java, .NET, React, iOS , QA and Angular Developer

 Job alert for Python, PHP, Java, .NET, React, iOS, QA, and Angular Developer:- Now I am posting Job alerts to PHP, JAVA, .NET, React, iOS, QA, and Angular Profile Candidate. Apply for Job to the hr email id. If you want to Join the 100% Placement oriented program then you can call us at 0731-4069788,7805063968. for more info visit www.shivaconceptsolution.com

How to call Rest API in React JS using Fetch Method

It is used to provide data communication from one application to another, API will be developed by any server-side script such as Java, Python, PHP, NODE, etc. What is RestAPI? RestAPI is used to transfer the data using the HTTP method and return output data into JSON format. It provides better performance as compare to SOAP-based API. REST means Representation state transfer-based API. List of HTTP Request methods GET  - is used to request data from a specified resource. POST  - is used to send data to a server to create a resource. PUT  - is used to send data to a server to update a resource. DELETE  - is used to delete the specified resource. How to write code on REST API services implementation? 1) AXIOX 2)  Fetch now we implement an example of the Fetch API method of React JS to show data in tabular format. Step1st:- 1)  Create a Component and Write the following code. of React Js import React from "react"; export class RestApiCall extends React.Compon...