Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7190301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:29:05+00:00 2026-05-28T19:29:05+00:00

I have a list such as { {1 ,1 }, Q}, { {2 ,3

  • 0

I have a list such as { {1 ,1 }, "Q"}, { {2 ,3 }, "E"}, { {3 ,5 }, "Q"}, { {4 ,2 }, "Q"}, { {5 ,4 }, "Q"}, { {1 ,5 }, "E"}, and I need to show the characters in a rectangular grid, for example, in this case, 5*5 grid, such that on (1, 1), there is a char Q, on (2, 3) there is a letter Q, …, and on (1, 5) there is a letter E. And all the remaining positions in the grid is shown as blank.

Please help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:29:06+00:00Added an answer on May 28, 2026 at 7:29 pm

    SparseArray is set up to do this. This also uses @@@ which is short for Apply at level 1:

    dat =
    {{{1, 1}, "Q"},
     {{2, 3}, "E"},
     {{3, 5}, "Q"},
     {{4, 2}, "Q"},
     {{5, 4}, "Q"},
     {{1, 5}, "E"}};
    
    SparseArray[Rule @@@ dat, {5, 5}, ""] // MatrixForm
    

    Mathematica graphics

    The second argument of SparseArray (here {5, 5}) is the explicit array size. You can use Automatic to have it sized to the farthest point of your data. The third (optional) argument is the expression to use as the “background” of the array. Here I use an empty string "" to meet your request for “blank.” Since this becomes hard to read you may prefer grid lines:

    Grid[
     SparseArray[Rule @@@ dat, {5, 5}, ""],
     Frame -> All
    ]
    

    Mathematica graphics

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of values such as 12000,12345,123456 that need to be converted
I have this scenario. I need to show 3 list boxes on a ASP.NET
For example I have such query: Query q = sess.createQuery(from Cat cat); List cats
I have a List of HashMap such as below ArrayList l = new ArrayList
If I have a list in python such as: stuff = [1, 2, 3,
I have a list of values as such: row = ['0x14', '0xb6', '0xa1', '0x0',
I have a list containing version strings, such as things: versions_list = [1.1.2, 1.0.0,
I have such a class: public class Cycle { public List<int> Edges { get;
Suppose I have an IEnumerable such as a List(TValue) and I want to keep
If I have a method in MyClass such as setSuperClassList(List<Superclass>) ...should I be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.