<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sachin Ponnapalli</title>
    <description>The latest articles on DEV Community by Sachin Ponnapalli (@sachinponnapalli).</description>
    <link>https://dev.to/sachinponnapalli</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F653086%2F1fc451f1-0832-46f1-9d63-80655de8959d.jpeg</url>
      <title>DEV Community: Sachin Ponnapalli</title>
      <link>https://dev.to/sachinponnapalli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sachinponnapalli"/>
    <language>en</language>
    <item>
      <title>Program to Print X Star Pattern in C, C++, and Python</title>
      <dc:creator>Sachin Ponnapalli</dc:creator>
      <pubDate>Thu, 08 Jul 2021 12:34:52 +0000</pubDate>
      <link>https://dev.to/sachinponnapalli/program-to-print-x-star-pattern-in-c-c-and-python-2mnf</link>
      <guid>https://dev.to/sachinponnapalli/program-to-print-x-star-pattern-in-c-c-and-python-2mnf</guid>
      <description>&lt;p&gt;Give the rows of the pattern the task is to print X star Pattern in C, C++, and Python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;Given number of rows =10&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;pre id="codeOutputPre"&gt;*                 * 
  *             *   
    *         *     
      *     *       
        * *         
        * *         
      *     *       
    *         *     
  *             *   
*                 *&lt;/pre&gt;
&lt;strong&gt;Example2:&lt;/strong&gt;

&lt;strong&gt;Input:&lt;/strong&gt;
&lt;pre&gt;Given number of rows =10
Given character to print='@'&lt;/pre&gt;
&lt;strong&gt;Output:&lt;/strong&gt;
&lt;pre id="codeOutputPre"&gt;Enter some random number of rows = 10
Enter some random character = @
@                 @ 
  @             @   
    @         @     
      @     @       
        @ @         
        @ @         
      @     @       
    @         @     
  @             @   
@                 @&lt;/pre&gt;
&lt;h2&gt;Program to Print X Star Pattern in C, C++, and Python&lt;/h2&gt;
Below are the ways to print the X Star Pattern in C, C++, and Python.
&lt;ul&gt;
    &lt;li&gt;Using For Loop (Star Character)&lt;/li&gt;
    &lt;li&gt;Using For Loop (User Character)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="Using_For_Loop_(Star_Character)"&gt;Method #1: Using For Loop (Star Character)&lt;/h3&gt;
&lt;strong&gt;Approach:&lt;/strong&gt;
&lt;ul&gt;
    &lt;li&gt;Give the number of rows of the x pattern as static input and store it in a variable.&lt;/li&gt;
    &lt;li&gt;Loop from 0 to the number of rows using For loop.&lt;/li&gt;
    &lt;li&gt;Loop from 0 to the number of rows using another For loop(Inner For loop).&lt;/li&gt;
    &lt;li&gt;Check if the parent loop iterator value is equal to the inner loop iterator value or if the inner loop iterator value is equal to the number of rows-parent loop iterator value-1 using If conditional Statement.&lt;/li&gt;
    &lt;li&gt;Print the star character with space if the condition is true.&lt;/li&gt;
    &lt;li&gt;Else print space character.&lt;/li&gt;
    &lt;li&gt;Print the newline character after the end of the inner For loop.&lt;/li&gt;
    &lt;li&gt;The Exit of the program.&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;1) Python Implementation&lt;/strong&gt;

&lt;strong&gt;Below is the implementation:&lt;/strong&gt;
&lt;pre&gt;# Give the number of rows of the x pattern as static input and store it in a variable.
xrows=10

#Loop from 0 to the number of rows using For loop.
for m in range(0, xrows):
    # Loop from 0 to the number of rows using another For loop(Inner For loop).
    for n in range(0, xrows):
        '''Check if the parent loop iterator value is equal to the inner loop 
        iterator value or if the inner loop iterator value is equal to the number
        of rows-parent loop iterator value-1 using If conditional Statement.'''
        if(m==n or n==xrows - 1 - m):
          #Print the star character with space if the condition is true.
          print('*',end=' ')
        else:
          #Else print space character.
          print(' ',end=' ')
     #Print the newline character after the end of the inner For loop.      
    print()
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;pre id="codeOutputPre"&gt;*                 * 
  *             *   
    *         *     
      *     *       
        * *         
        * *         
      *     *       
    *         *     
  *             *   
*                 *&lt;/pre&gt;
&lt;li&gt;&lt;a href="https://btechgeeks.com/python-program-to-print-plus-star-pattern/"&gt;Python Program to Print Plus Star Pattern&lt;/a&gt;&lt;/li&gt;
 
&lt;strong&gt;2) C++ Implementation&lt;/strong&gt;

&lt;strong&gt;Below is the implementation:&lt;/strong&gt;
&lt;pre&gt;#include &amp;lt;iostream&amp;gt;
using namespace std;

int main()
{
    // Give the number of rows of the x pattern as static
    // input and store it in a variable.
    int xrows = 10;

    // Loop from 0 to the number of rows using For loop.
    for (int m = 0; m &amp;lt; xrows; m++) {
        // Loop from 0 to the number of rows using another
        // For loop(Inner For loop).
        for (int n = 0; n &amp;lt; xrows; n++) {
            /*Check if the parent loop iterator value is
            equal to the inner loop iterator value or if the
            inner loop iterator value is equal to the
            number of rows-parent loop iterator value-1
            using If conditional Statement.*/
            if (n == m or n == (xrows - m - 1)) {
                // Print the star character with space if
                // the condition is true.
                cout &amp;lt;&amp;lt; "* ";
            }
            else {
                // Else print space character.
                cout &amp;lt;&amp;lt; "  ";
            }
        }
        // Print the newline character after the end of
        // the inner For loop.
        cout &amp;lt;&amp;lt; endl;
    }

    return 0;
}&lt;/pre&gt;
&lt;strong&gt;Output:&lt;/strong&gt;
&lt;pre id="codeOutputPre"&gt;*                 * 
  *             *   
    *         *     
      *     *       
        * *         
        * *         
      *     *       
    *         *     
  *             *   
*                 *&lt;/pre&gt;
&lt;strong&gt;3) C Implementation&lt;/strong&gt;

&lt;strong&gt;Below is the implementation:&lt;/strong&gt;
&lt;pre&gt;#include &amp;lt;stdio.h&amp;gt;

int main()
{
  // Give the number of rows of the x pattern as static
    // input and store it in a variable.
    int xrows = 10;

    // Loop from 0 to the number of rows using For loop.
    for (int m = 0; m &amp;lt; xrows; m++) {
        // Loop from 0 to the number of rows using another
        // For loop(Inner For loop).
        for (int n = 0; n &amp;lt; xrows; n++) {
            /*Check if the parent loop iterator value is
            equal to the inner loop iterator value or if the
            inner loop iterator value is equal to the
            number of rows-parent loop iterator value-1
            using If conditional Statement.*/
            if (n == m || n == (xrows - m - 1)) {
                // Print the star character with space if
                // the condition is true.
                printf("* ");
            }
            else {
                // Else print space character.
                printf("  ");
            }
        }
        // Print the newline character after the end of
        // the inner For loop.
        printf("\n");
    }

    return 0;
}&lt;/pre&gt;
&lt;strong&gt;Output:&lt;/strong&gt;
&lt;pre id="codeOutputPre"&gt;*                 * 
  *             *   
    *         *     
      *     *       
        * *         
        * *         
      *     *       
    *         *     
  *             *   
*                 *&lt;/pre&gt;
&lt;h3 id="Using_For_Loop_(User_Character)"&gt;Method #2: Using For Loop (User Character)&lt;/h3&gt;
&lt;strong&gt;Approach:&lt;/strong&gt;
&lt;ul&gt;
    &lt;li&gt;Give the number of rows of the x pattern as user input and store it in a variable.&lt;/li&gt;
    &lt;li&gt;Give the character to print as user input and store it in a variable.&lt;/li&gt;
    &lt;li&gt;Loop from 0 to the number of rows using For loop.&lt;/li&gt;
    &lt;li&gt;Loop from 0 to the number of rows using another For loop(Inner For loop).&lt;/li&gt;
    &lt;li&gt;Check if the parent loop iterator value is equal to the inner loop iterator value or if the inner loop iterator value is equal to the number of rows-parent loop iterator value-1 using If conditional Statement.&lt;/li&gt;
    &lt;li&gt;Print the given character with space if the condition is true.&lt;/li&gt;
    &lt;li&gt;Else print space character.&lt;/li&gt;
    &lt;li&gt;Print the newline character after the end of the inner For loop.&lt;/li&gt;
    &lt;li&gt;The Exit of the program.&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;1) Python Implementation&lt;/strong&gt;
&lt;ul&gt;
    &lt;li&gt;Give the number of rows as user input using int(input()) and store it in a variable.&lt;/li&gt;
    &lt;li&gt;Give the Character as user input using input() and store it in another variable.&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;Below is the implementation:&lt;/strong&gt;
&lt;pre&gt;# Give the number of rows  as user input using int(input()) and store it in a variable.
xrows = int(input(
    'Enter some random number of rows  = '))
# Give the Character as user input using input() and store it in another variable.
givencharacter = input('Enter some random character = ')
# Loop from 0 to the number of rows using For loop.
for m in range(0, xrows):
    # Loop from 0 to the number of rows using another For loop(Inner For loop).
    for n in range(0, xrows):
        '''Check if the parent loop iterator value is equal to the inner loop 
        iterator value or if the inner loop iterator value is equal to the number
        of rows-parent loop iterator value-1 using If conditional Statement.'''
        if(m == n or n == xrows - 1 - m):
            # Print the given character with space if the condition is true.
            print(givencharacter, end=' ')
        else:
            # Else print space character.
            print(' ', end=' ')
       # Print the newline character after the end of the inner For loop.
    print()
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;pre id="codeOutputPre"&gt;Enter some random number of rows = 10
Enter some random character = @
@                 @ 
  @             @   
    @         @     
      @     @       
        @ @         
        @ @         
      @     @       
    @         @     
  @             @   
@                 @&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;2) C++ Implementation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Give the number of rows as user input using cin and store it in a variable.&lt;/li&gt;
    &lt;li&gt;Give the Character as user input using cin and store it in another variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Below is the implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;#include &amp;lt;iostream&amp;gt;
using namespace std;

int main()
{
    // Give the number of rows
    // as user input using cin and store it in a
    // variable.
    int xrows;
    char givencharacter;
    cout &amp;lt;&amp;lt; "Enter some random number of rows = " &amp;lt;&amp;lt; endl;
    cin &amp;gt;&amp;gt; xrows;
    // Give the Character as user input using cin and store
    // it in another variable.
    cout &amp;lt;&amp;lt; "Enter some random character = " &amp;lt;&amp;lt; endl;
    cin &amp;gt;&amp;gt; givencharacter;
    cout &amp;lt;&amp;lt; endl;
    // Loop from 0 to the number of rows using For loop.
    for (int m = 0; m &amp;lt; xrows; m++) {
        // Loop from 0 to the number of rows using another
        // For loop(Inner For loop).
        for (int n = 0; n &amp;lt; xrows; n++) {
            /*Check if the parent loop iterator value is
            equal to the inner loop iterator value or if the
            inner loop iterator value is equal to the
            number of rows-parent loop iterator value-1
            using If conditional Statement.*/
            if (n == m || n == (xrows - m - 1)) {
                // Print the given  character with space if
                // the condition is true.
                cout &amp;lt;&amp;lt; givencharacter &amp;lt;&amp;lt; " ";
            }
            else {
                // Else print space character.
                cout &amp;lt;&amp;lt; "  ";
            }
        }
        // Print the newline character after the end of
        // the inner For loop.
        cout &amp;lt;&amp;lt; endl;
    }

    return 0;
}&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;pre id="codeOutputPre"&gt;Enter some random number of rows = 
10
Enter some random character = 
@
@                 @ 
  @             @   
    @         @     
      @     @       
        @ @         
        @ @         
      @     @       
    @         @     
  @             @   
@                 @&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;3) C Implementation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Give the number of rows as user input using scanf and store it in a variable.&lt;/li&gt;
    &lt;li&gt;Give the Character as user input using scanf and store it in another variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Below is the implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;#include &amp;lt;stdio.h&amp;gt;

int main()
{

    // Give the number of rows
    //  as user input using scanf and store it in a
    // variable.
    int xrows;
    char givencharacter;
    // Give the Character as user input using scanf and
    // store it in another variable.
    scanf("%d", &amp;amp;xrows);
    scanf("%c", &amp;amp;givencharacter);
    printf("\n");

    // Loop from 0 to the number of rows using For loop.
    for (int m = 0; m &amp;lt; xrows; m++) {
        // Loop from 0 to the number of rows using another
        // For loop(Inner For loop).
        for (int n = 0; n &amp;lt; xrows; n++) {
            /*Check if the parent loop iterator value is
            equal to the inner loop iterator value or if the
            inner loop iterator value is equal to the
            number of rows-parent loop iterator value-1
            using If conditional Statement.*/
            if (n == m || n == (xrows - m - 1)) {
                // Print the given character with space if
                // the condition is true.
                printf("%c", givencharacter);
            }
            else {
                // Else print space character.
                printf("  ");
            }
        }
        // Print the newline character after the end of
        // the inner For loop.
        printf("\n");
    }

    return 0;
}&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;pre id="codeOutputPre"&gt;10@
@                 @ 
  @             @   
    @         @     
      @     @       
        @ @         
        @ @         
      @     @       
    @         @     
  @             @   
@                 @&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>cpp</category>
    </item>
    <item>
      <title>Java Program to Print Square Pattern Star Pattern</title>
      <dc:creator>Sachin Ponnapalli</dc:creator>
      <pubDate>Thu, 08 Jul 2021 12:01:19 +0000</pubDate>
      <link>https://dev.to/sachinponnapalli/java-program-to-print-square-pattern-star-pattern-50ne</link>
      <guid>https://dev.to/sachinponnapalli/java-program-to-print-square-pattern-star-pattern-50ne</guid>
      <description>&lt;p&gt;Program to Print Square Star Pattern&lt;br&gt;
In this article we are going to see how to print the square  star program.&lt;/p&gt;

&lt;pre&gt;Example-1

When row value=4
****
****
****
****&lt;/pre&gt;
&lt;pre&gt;Example-2:

When row value=5
*****
*****
*****
*****
*****&lt;/pre&gt;
Now, let's see the actual program to print it.

&lt;strong&gt;Approach:&lt;/strong&gt;
&lt;ul&gt;
    &lt;li&gt;Enter total row and store it in an integer variable &lt;code&gt;row&lt;/code&gt;.&lt;/li&gt;
    &lt;li&gt;Take first for loop to print all rows.&lt;/li&gt;
    &lt;li&gt;Take second/inner for loop to print column values.&lt;/li&gt;
    &lt;li&gt;Then go on printing the star symbols according to the iteration.&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;JAVA Code:&lt;/strong&gt;
&lt;ul&gt;
    &lt;li&gt;Static Star Character&lt;/li&gt;
    &lt;li&gt;User Input Character&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
&lt;a id="Static_Star_Character"&gt;&lt;/a&gt;Method-1 : Static Star Pattern&lt;/h3&gt;
&lt;pre&gt;import java.util.*;
public class Main 
{    
    public static void main(String args[])   
    {   // taking variable for loop iteration and row .
    int row,r,c,d;
    //creating object 
    Scanner s = new Scanner(System.in);
    // entering the number of row
    System.out.print("Enter rows : ");
    row = s.nextInt();
    //for loop for rows
    for(  r=0;r&amp;lt;row;r++)
        {
            // printing stars
            for( c=0;c&amp;lt;row;c++)
                 System.out.print("*");
            System.out.println();
       }             
    }
}

&lt;/pre&gt;

&lt;pre&gt;Output:

Enter rows : 5
*****
*****
*****
*****
*****&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://btechgeeks.com/java-program-to-print-pyramid-star-pattern/"&gt;Java Program to Print Pyramid Star Pattern&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://btechgeeks.com/java-program-to-print-inverted-pyramid-star-pattern/"&gt;Java Program to Print Inverted Pyramid Star Pattern&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
&lt;a id="User_Input_Character"&gt;&lt;/a&gt;Method-2 : User Input Pattern&lt;/h3&gt;
&lt;pre&gt;import java.util.*;
public class Main 
{    
    public static void main(String args[])   
    {   // taking variable for loop iteration and row .
    int row,r,c,d;
    //creating object 
    Scanner s = new Scanner(System.in);
    // entering the number of row
    System.out.print("Enter rows : ");
    row = s.nextInt();
    // entering any character
    System.out.print("Enter any character : ");
    char sym = s.next().charAt(0);
    //for loop for rows
    for(  r=0;r&amp;lt;row;r++)
        {
            // printing stars
            for( c=0;c&amp;lt;row;c++)
                 System.out.print(sym);
            System.out.println();
       }             
    }
}

&lt;/pre&gt;

&lt;pre&gt;Output:

Enter rows : 5
Enter any character : #
#####
#####
#####
#####
#####&lt;/pre&gt;
&lt;strong&gt;Explanation :&lt;/strong&gt;

Let's understand the program by going through the detailed explanation.

We have taken row value as 5.

&lt;strong&gt;Iteration-1&lt;/strong&gt;
r=0 (passes the first for loop condition) because it will execute until &lt;code&gt;r&amp;lt; row&lt;/code&gt;
Star will be printed 5 time because inner for loop will be executed &lt;code&gt;row&lt;/code&gt; time .
&lt;pre&gt;*****&lt;/pre&gt;
&lt;strong&gt;Iteration-2&lt;/strong&gt;
r=1 (passes the first for loop condition) because it will execute until &lt;code&gt;r&amp;lt; row&lt;/code&gt;
Star will be printed 5 time because inner for loop will be executed &lt;code&gt;row&lt;/code&gt; time .
&lt;pre&gt;*****&lt;/pre&gt;
&lt;strong&gt;Iteration-3&lt;/strong&gt;
r=2 (passes the first for loop condition) because it will execute until &lt;code&gt;r&amp;lt; row&lt;/code&gt;
Star will be printed 5 time because inner for loop will be executed &lt;code&gt;row&lt;/code&gt; time .
&lt;pre&gt;*****&lt;/pre&gt;
&lt;strong&gt;Iteration-4&lt;/strong&gt;

r=3 (passes the first for loop condition) because it will execute until &lt;code&gt;r&amp;lt; row&lt;/code&gt;
Star will be printed 5 time because inner for loop will be executed &lt;code&gt;row&lt;/code&gt; time .
&lt;pre&gt;*****&lt;/pre&gt;
&lt;strong&gt;Iteration-5&lt;/strong&gt;

r=4 (passes the first for loop condition) because it will execute until &lt;code&gt;r&amp;lt; row&lt;/code&gt;
Star will be printed 5 time because inner for loop will be executed &lt;code&gt;row&lt;/code&gt; time .
&lt;pre&gt;*****&lt;/pre&gt;
Now i=5, so first for loop condition will fail.  So next for loop will not be executed any more.

Now, after end of all iteration we will see the complete pattern is printed on the output screen like this.
&lt;pre&gt;*****
*****
*****
*****
*****&lt;/pre&gt;
&lt;strong&gt;C Code:&lt;/strong&gt;
&lt;pre&gt;#include &amp;lt;stdio.h&amp;gt;
int main() {
   int r, row, c ,d;
   printf("Enter rows: ");
   scanf("%d", &amp;amp;row);
  for(  r=0;r&amp;lt;row;r++)
        {
            // printing stars
            for( c=0;c&amp;lt;row;c++)
                printf("*");
           printf("\n");
       } 
   return 0;
}

&lt;/pre&gt;

&lt;pre&gt;Output:

Enter rows : 5
*****
*****
*****
*****
*****&lt;/pre&gt;
&lt;strong&gt;C++ Code:&lt;/strong&gt;
&lt;pre&gt;#include &amp;lt;iostream&amp;gt;
using namespace std;
int main()
{
   int row, r , c ,d ;
   cout &amp;lt;&amp;lt; "Enter  rows: ";
   cin &amp;gt;&amp;gt; row;
  for(  r=0;r&amp;lt;row;r++)
        {
            // printing stars
            for( c=0;c&amp;lt;row;c++)
                cout&amp;lt;&amp;lt; "*" ;
          cout &amp;lt;&amp;lt; "\n" ;
       } 
    return 0;   
}
&lt;/pre&gt;

&lt;pre&gt;Output:

Enter rows : 5
*****
*****
*****
*****
*****&lt;/pre&gt;

</description>
      <category>java</category>
      <category>programming</category>
    </item>
    <item>
      <title>Python Pandas : How to Create DataFrame from dictionary ?</title>
      <dc:creator>Sachin Ponnapalli</dc:creator>
      <pubDate>Mon, 28 Jun 2021 06:26:42 +0000</pubDate>
      <link>https://dev.to/sachinponnapalli/python-pandas-how-to-create-dataframe-from-dictionary-8bb</link>
      <guid>https://dev.to/sachinponnapalli/python-pandas-how-to-create-dataframe-from-dictionary-8bb</guid>
      <description>&lt;h2&gt;How to create DataFrame from dictionary in Python ?&lt;/h2&gt;

&lt;p&gt;In this article we will discuss about various ways of creating DataFrame object from dictionaries.&lt;/p&gt;

&lt;p&gt;So, let's start exploring different approaches to achieve this result.&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Create DataFrame from Dictionary using default Constructor&lt;/li&gt;
    &lt;li&gt;Create DataFrame from Dictionary with custom indexes&lt;/li&gt;
    &lt;li&gt;Create DataFrame from Dictionary and skip data&lt;/li&gt;
    &lt;li&gt;Create DataFrame from Dictionary with different Orientation&lt;/li&gt;
    &lt;li&gt;Create DataFrame from nested Dictionary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Want to expert in the python programming language? Exploring &lt;a href="https://btechgeeks.com/python-data-analysis-using-pandas/"&gt;Python Data Analysis using Pandas&lt;/a&gt; tutorial changes your knowledge from basic to advance level in python concepts.&lt;/p&gt;

&lt;h3&gt;
&lt;a id="Create_DataFrame_from_Dictionary_using_default_Constructor"&gt;&lt;/a&gt;Method-1 : Create DataFrame from Dictionary using default Constructor :&lt;/h3&gt;

&lt;p&gt;In python DataFrame constructor accepts n-D array, dictionaries etc.&lt;/p&gt;

&lt;pre&gt;&lt;span&gt;Syntax : pandas.&lt;/span&gt;&lt;span&gt;DataFrame&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;data=&lt;/span&gt;&lt;span&gt;None&lt;/span&gt;&lt;span&gt;, index=&lt;/span&gt;&lt;span&gt;None&lt;/span&gt;&lt;span&gt;, columns=&lt;/span&gt;&lt;span&gt;None&lt;/span&gt;&lt;span&gt;, dtype=&lt;/span&gt;&lt;span&gt;None&lt;/span&gt;&lt;span&gt;, copy=&lt;/span&gt;&lt;span&gt;False&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/pre&gt;

&lt;pre&gt;#program :

# import pandas library
import pandas as pd
  
# dictionary with list object in values
data = {
    'Name' : ['Satya', 'Omm', 'Rakesh'],
    'Age' : [21, 21, 23],
    'From' : ['BBSR', 'RKL', 'KDP']
}
  
# creating a Dataframe object 
df_obj = pd.DataFrame(data)
  
df_obj


&lt;/pre&gt;

&lt;pre&gt;Output :

         Name    Age   From
0      Satya      21      BBSR
1      Omm      21      RKL
2      Rakesh    23       KDP&lt;/pre&gt;
All keys in dictionary are converted to column name and values in dictionaries converted column data.
&lt;h3&gt;
&lt;a id="Create_DataFrame_from_Dictionary_with_custom_indexes"&gt;&lt;/a&gt;Method-2 : Create DataFrame from Dictionary with custom indexes :&lt;/h3&gt;
&lt;pre&gt;#program :

# import pandas library
import pandas as pd
  
# dictionary with list object in values
data = {
    'Name' : ['Satya', 'Omm', 'Rakesh'],
    'Age' : [21, 21, 23],
    'From' : ['BBSR', 'RKL', 'KDP']
}
  
# creating a Dataframe object 
df_obj = pd.DataFrame(data, index = ['a','b','c'])
  
df_obj

&lt;/pre&gt;

&lt;pre&gt;Output :
        Name    Age     From
a      Satya      21      BBSR
b     Omm       21     RKL
c     Rakesh     23     KDP&lt;/pre&gt;
By passing index list, we can avoid the default index.
&lt;h3&gt;
&lt;a id="Create_DataFrame_from_Dictionary_and_skip_data"&gt;&lt;/a&gt;Method-3 : Create DataFrame from Dictionary and skip data&lt;/h3&gt;
By skipping some of the items of dictionary, we can also create a DataFrame object from dictionary

Let's see the implementation of that.
&lt;pre&gt;#program :

# import pandas library
import pandas as pd
  
# dictionary with list object in values
data = {
    'Name' : ['Satya', 'Omm', 'Rakesh'],
    'Age' : [21, 21, 23],
    'From' : ['BBSR', 'RKL', 'KDP']
}
  
# creating a Dataframe object 
#items skipped with key 'Age'
df_obj = pd.DataFrame(data, columns=['name', 'From'])
  
df_obj


&lt;/pre&gt;

&lt;pre&gt;Output :
       Name        From
0      Satya        BBSR
1     Omm          RKL
2     Rakesh       KDP&lt;/pre&gt;
&lt;h3&gt;
&lt;a id="Create_DataFrame_from_Dictionary_with_different_Orientation"&gt;&lt;/a&gt;Method-4 : Create DataFrame from Dictionary with different Orientation&lt;/h3&gt;
DataFrame can also be created from dictionary using &lt;code&gt;DataFrame.from_dict()&lt;/code&gt; function.
&lt;pre&gt;&lt;span&gt;DataFrame.&lt;/span&gt;&lt;span&gt;from_dict&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;data, orient=&lt;/span&gt;&lt;span&gt;'columns'&lt;/span&gt;&lt;span&gt;, dtype=&lt;/span&gt;&lt;span&gt;None&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/pre&gt;
It accepts orientation too, where we can pass the orientation as index then the keys which were used as columns during creating DataFrame now they will be used as index.

Let's see the implementation of that.
&lt;pre&gt;#program :

# import pandas library
import pandas as pd
  
# dictionary with list object in values
data = {
    'Name' : ['Satya', 'Omm', 'Rakesh'],
    'Age' : [21, 21, 23],
    'From' : ['BBSR', 'RKL', 'KDP']
}
  
# creating a Dataframe object 
#items skipped with key 'Age'
df_obj = pd.DataFrame(data,orient='index')
  
df_obj


&lt;/pre&gt;

&lt;pre&gt;Output :

&lt;span&gt;             0&lt;/span&gt;           &lt;span&gt;1&lt;/span&gt;            &lt;span&gt;2&lt;/span&gt;

&lt;span&gt;Aame   Satya   Omm     Rakesh&lt;/span&gt;

&lt;span&gt;From     BBSR    RKL       KDP&lt;/span&gt;

&lt;span&gt;Age       21         21         23&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;
&lt;a id="Create_DataFrame_from_nested_Dictionary"&gt;&lt;/a&gt;Method-5 : Create DataFrame from nested Dictionary :&lt;/h3&gt;
Suppose we have a nested dictionary, then we ill directly pass it in DataFrame constructor where the keys of dictionary will be used as column.

Let's see the implementation of that.
&lt;pre&gt;#program :

# import pandas library
import pandas as pd
  
# dictionary with list object in values
# Nested Dictionary
data = { 
0 : {
    'Name' : 'Satya',
    'Age' : 21,
    'From' : 'BBSR'
    },
1 : {
    'Name' : 'Omm',
    'Age' : 21,
    'From' : 'RKL'
    },
2 : {
    'Name' : 'Rakesh',
    'Age' : 23,
    'From' : 'KDP'
    }
}
  
# creating a Dataframe object 
#items skipped with key 'Age'
df_obj = pd.DataFrame(data)
  
df_obj

&lt;/pre&gt;

&lt;pre&gt;Output :
&lt;span&gt;             0&lt;/span&gt;           &lt;span&gt;1&lt;/span&gt;            &lt;span&gt;2&lt;/span&gt;
&lt;span&gt;Aame   Satya   Omm     Rakesh&lt;/span&gt;
&lt;span&gt;From     BBSR    RKL       KDP&lt;/span&gt;
&lt;span&gt;Age       21         21         23&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Read more Articles on Python Data Analysis Using Padas - Creating Dataframe Objects&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;&lt;a href="https://btechgeeks.com/pandas-how-to-create-an-empty-dataframe-and-append-rows-columns-to-it-in-python/"&gt;How to create an empty DataFrame and add data to it later?&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="https://btechgeeks.com/python-pandas-how-to-convert-lists-to-a-dataframe/"&gt;How to convert lists to a dataframe?&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="https://btechgeeks.com/read-csv-file-to-dataframe-with-custom-delimiter-in-python/"&gt;How to read a csv file to Dataframe with custom delimiter?&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="https://btechgeeks.com/pandas-skip-rows-while-reading-csv-file-to-a-dataframe-using-read_csv-in-python/"&gt;How to skip rows while reading csv file to a Dataframe using read_csv()?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>Disarium Number in Python</title>
      <dc:creator>Sachin Ponnapalli</dc:creator>
      <pubDate>Mon, 28 Jun 2021 06:22:28 +0000</pubDate>
      <link>https://dev.to/sachinponnapalli/disarium-number-in-python-35k7</link>
      <guid>https://dev.to/sachinponnapalli/disarium-number-in-python-35k7</guid>
      <description>&lt;p&gt;&lt;strong&gt;Disarium Number:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Disarium number is one in which the sum of each digit raised to the power of its respective position equals the original number.&lt;/p&gt;

&lt;p&gt;like 135 , 89 etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;number =135&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;pre id="codeOutputPre"&gt;135 is disarium number&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;Here 1^1 + 3^2 + 5^3 = 135 so it is disarium Number&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Example2:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;number =79&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;pre id="codeOutputPre"&gt;79 is not disarium number&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;Here 7^1 + 9^2 = 87 not equal to 79  so it is not disarium Number&lt;/pre&gt;

&lt;h2&gt;Disarium Number in Python&lt;/h2&gt;

&lt;p&gt;Below are the ways to check Disarium number in python&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Using while loop&lt;/li&gt;
    &lt;li&gt;By converting the number to string and Traversing the string to extract the digits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Explore more instances related to python concepts from &lt;a href="https://btechgeeks.com/python-programming-examples-with-output/"&gt;Python Programming Examples&lt;/a&gt; Guide and get promoted from beginner to professional programmer level in Python Programming Language.&lt;/p&gt;

&lt;h3 id="Using_while_loop"&gt;Method #1: Using while loop&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Algorithm:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Scan the number and calculate the size of the number.&lt;/li&gt;
    &lt;li&gt;Make a copy of the number so you can verify the outcome later.&lt;/li&gt;
    &lt;li&gt;Make a result variable (with a value of 0) and an iterator ( set to the size of the number)&lt;/li&gt;
    &lt;li&gt;Create a while loop to go digit by digit through the number.&lt;/li&gt;
    &lt;li&gt;On each iteration, multiply the result by a digit raised to the power of the iterator value.&lt;/li&gt;
    &lt;li&gt;On each traversal, increment the iterator.&lt;/li&gt;
    &lt;li&gt;Compare the result value to a copy of the original number.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Below is the implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;# given number
num = 135
# intialize result to zero(ans)
ans = 0
# calculating the digits
digits = len(str(num))
# copy the number in another variable(duplicate)
dup_number = num
while (dup_number != 0):

    # getting the last digit
    remainder = dup_number % 10

    # multiply the result by a digit raised to the power of the iterator value.
    ans = ans + remainder**digits
    digits = digits - 1
    dup_number = dup_number//10
# It is disarium number if it is equal to original number
if(num == ans):
    print(num, "is disarium number")
else:
    print(num, "is not disarium number")
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;pre id="codeOutputPre"&gt;135 is disarium number&lt;/pre&gt;

&lt;h3 id="By_converting_the_number_to_string_and_Traversing_the_string_to_extract_the_digits"&gt;Method #2: By converting the number to string and Traversing the string to extract the digits&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Algorithm:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Initialize a variable say &lt;strong&gt;ans&lt;/strong&gt; to 0&lt;/li&gt;
    &lt;li&gt;Using a new variable, we must convert the given number to a string.&lt;/li&gt;
    &lt;li&gt;Take a temp count =1 and increase the count after each iteration.&lt;/li&gt;
    &lt;li&gt;Iterate through the string, convert each character to an integer, multiply the &lt;strong&gt;ans&lt;/strong&gt; by a digit raised to the power of the count.&lt;/li&gt;
    &lt;li&gt;If the &lt;strong&gt;ans&lt;/strong&gt; is equal to given number then it is disarium number&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Below is the implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;# given number
num = 135
# intialize result to zero(ans)
ans = 0
# make a temp count to 1
count = 1
# converting given number to string
numString = str(num)
# Traverse through the string
for char in numString:
    # Converting the character of string to integer
    # multiply the ans by a digit raised to the power of the iterator value.
    ans = ans+int(char)**count
    count = count+1
# It is disarium number if it is equal to original number
if(num == ans):
    print(num, "is disarium number")
else:
    print(num, "is not disarium number")
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;pre id="codeOutputPre"&gt;135 is disarium number&lt;/pre&gt;

</description>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>Python Programming – NumPy Installation</title>
      <dc:creator>Sachin Ponnapalli</dc:creator>
      <pubDate>Mon, 28 Jun 2021 06:19:25 +0000</pubDate>
      <link>https://dev.to/sachinponnapalli/python-programming-numpy-installation-29k1</link>
      <guid>https://dev.to/sachinponnapalli/python-programming-numpy-installation-29k1</guid>
      <description>&lt;h2&gt;Python Programming – NumPy Installation&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Numpy installation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This section discusses the simple installation approaches of NumPy in different operating system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By default, NumPy is not shipped with official Python installer. But one can download (from website link: &lt;a href="http://sourceforge.net/projects/numpy/files/NumPy/"&gt;http://sourceforge.net/projects/numpy/files/NumPy/&lt;/a&gt;) the executable file of NumPy (recent version 1.8.1) followed by installing it. Before installing NumPy, please make sure that Python is already installed. NumPy is already included in Python(x,y) package, so one does not have to install NumPy separately, if the programmer is using Python(x,y).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linux&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One can install NumPy in Ubuntu (Linux) operating system by executing the following commands in the terminal (as shown in figure 6-1).&lt;/p&gt;

&lt;pre&gt;sudo apt-get install python-numpy&lt;/pre&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hGLSmuuz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://btechgeeks.com/wp-content/uploads/2021/04/Python-Handwritten-Notes-Chapter-7-img-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hGLSmuuz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://btechgeeks.com/wp-content/uploads/2021/04/Python-Handwritten-Notes-Chapter-7-img-1.png" alt="Python Handwritten Notes Chapter 7 img 1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some of the data types supported by NumPy are given in table 6-1.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;Data type&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Description&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bool_&lt;/td&gt;
&lt;td&gt;Boolean (True or False) stored as a byte.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;intS&lt;/td&gt;
&lt;td&gt;Byte (ranging from -128 to 127).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;intl6&lt;/td&gt;
&lt;td&gt;Integer (ranging from -32768 to 32767).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;int32&lt;/td&gt;
&lt;td&gt;Integer (ranging from -2147483648 to 2147483647).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;int64&lt;/td&gt;
&lt;td&gt;Integer (ranging from -9223372036854775808 to 9223372036854775807).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uint8&lt;/td&gt;
&lt;td&gt;Unsigned integer (ranging from 0 to 255).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uintl6&lt;/td&gt;
&lt;td&gt;Unsigned integer (ranging from 0 to 65535).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uint32&lt;/td&gt;
&lt;td&gt;Unsigned integer (ranging from 0 to 4294967295).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uint64&lt;/td&gt;
&lt;td&gt;Unsigned integer (ranging from 0 to 18446744073709551615).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;float_&lt;/td&gt;
&lt;td&gt;Shorthand for float64.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;floatl6&lt;/td&gt;
&lt;td&gt;Half precision float: sign bit, 5 bits exponent, 10 bits mantissa.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;float32&lt;/td&gt;
&lt;td&gt;Single precision float: sign bit, 8 bits exponent, 23 bits mantissa.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;float64&lt;/td&gt;
&lt;td&gt;Double precision float: sign bit, 11 bits exponent, 52 bits mantissa.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;complex_&lt;/td&gt;
&lt;td&gt;Shorthand for complexl28.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;complex64&lt;/td&gt;
&lt;td&gt;Complex number, represented by two 32-bit floats (real and imaginary components).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;complexl28&lt;/td&gt;
&lt;td&gt;Complex number, represented by two 64-bit floats (real and imaginary components).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In this Page, We are Providing Python Programming – Numpy Installation. Students can visit for more Detail and Explanation of &lt;a href="https://btechgeeks.com/python-handwritten-notes/"&gt;Python Handwritten Notes&lt;/a&gt; Pdf.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Python Programming Lanuguage Tutorial</title>
      <dc:creator>Sachin Ponnapalli</dc:creator>
      <pubDate>Mon, 21 Jun 2021 09:14:32 +0000</pubDate>
      <link>https://dev.to/sachinponnapalli/python-programming-lanuguage-tutorial-3ggj</link>
      <guid>https://dev.to/sachinponnapalli/python-programming-lanuguage-tutorial-3ggj</guid>
      <description>&lt;p&gt;Do you Love to Program in Python Language? Are you completely new to the Phyton programming language? Then, refer to this ultimate guide on Python Programming and become the top programmer. For detailed information such as What is Python? Why we use it? Tips to Learn Python Programming Language, Applications for Python dive into this article.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
